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