clear expired sessions on server start
why wasn't i doing this before?? 😭
This commit is contained in:
parent
05ab207a1f
commit
1896633fd1
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue