Kritická chyba!
Tento commit je obsažen v:
rodič
6071c257b9
revize
7c01c70b4d
@ -322,14 +322,16 @@ pub async fn check_spam(
|
|||||||
return Err(NekrochanError::FloodError);
|
return Err(NekrochanError::FloodError);
|
||||||
}
|
}
|
||||||
|
|
||||||
let last_thread: i64 = ctx.cache().get(format!("last_thread:{ip}")).await?;
|
let last_thread: Option<i64> = ctx.cache().get(format!("last_thread:{ip}")).await?;
|
||||||
|
|
||||||
|
if let Some(last_thread) = last_thread {
|
||||||
let since_last_thread = Utc::now().timestamp_micros() - last_thread;
|
let since_last_thread = Utc::now().timestamp_micros() - last_thread;
|
||||||
let since_last_thread = Duration::microseconds(since_last_thread);
|
let since_last_thread = Duration::microseconds(since_last_thread);
|
||||||
|
|
||||||
if since_last_thread.num_seconds() < board.config.thread_cooldown {
|
if since_last_thread.num_seconds() < board.config.thread_cooldown {
|
||||||
return Err(NekrochanError::FloodError);
|
return Err(NekrochanError::FloodError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele