fix calculation for what the minimum acceptable session id is

This commit is contained in:
Charlotte 🦝 Delenk 2024-12-08 19:38:27 +01:00
parent 8495d0ad23
commit d5496d0a71
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -19,7 +19,7 @@ use tracing::{error, info, instrument};
#[instrument] #[instrument]
pub async fn expire(db: &Database) -> Result<()> { pub async fn expire(db: &Database) -> Result<()> {
let id = id_generator::generate(); let id = id_generator::generate();
let oldest_acceptable_id = id - ((24 * 60 * 60) << 48); let oldest_acceptable_id = id - ((24 * 60 * 60 * 1_000_000_000) << 48);
let oldest_acceptable_id = oldest_acceptable_id.to_be_bytes(); let oldest_acceptable_id = oldest_acceptable_id.to_be_bytes();
#[expect(clippy::panic, reason = "sqlx moment")] #[expect(clippy::panic, reason = "sqlx moment")]
query!( query!(