forked from jmug/stoatchat
Co-authored-by: izzy <me@insrt.uk> Signed-off-by: Zomatree <me@zomatree.live> Signed-off-by: izzy <me@insrt.uk>
15 lines
335 B
Rust
15 lines
335 B
Rust
use std::time::Duration;
|
|
|
|
use revolt_database::Database;
|
|
use revolt_result::Result;
|
|
use tokio::time::sleep;
|
|
|
|
pub async fn task(db: Database) -> Result<()> {
|
|
loop {
|
|
let count = db.delete_expired_tickets().await?;
|
|
log::info!("Pruned {count} expired MFA tickets");
|
|
|
|
sleep(Duration::from_mins(5)).await
|
|
}
|
|
}
|