Automatically remove orphan files

This commit is contained in:
2025-04-09 21:51:23 +02:00
parent 6f18aafc33
commit 7c04acaf4b
5 changed files with 15 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ pub async fn delete(user_id: UserID, token_id: TokenID) -> anyhow::Result<()> {
/// Remove outdated token
pub async fn cleanup() -> anyhow::Result<()> {
let query = format!(
"DELETE from token where time_used + max_inactivity < {};",
"DELETE from tokens where time_used + max_inactivity < {};",
time()
);
diesel::sql_query(query).execute(&mut db()?)?;