clear expired sessions on server start

why wasn't i doing this before?? 😭
This commit is contained in:
ari melody 2025-07-18 23:38:01 +01:00
parent 05ab207a1f
commit 1896633fd1
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
2 changed files with 11 additions and 0 deletions

View file

@ -188,3 +188,7 @@ func DeleteSession(db *sqlx.DB, token string) error {
return err
}
func DeleteExpiredSessions(db *sqlx.DB) error {
_, err := db.Exec("DELETE FROM session WHERE expires_at<current_timestamp")
return err
}