start work on invite keys

This commit is contained in:
2026-06-03 11:07:50 +03:00
parent 5853c8b7a8
commit 4083c950c5
9 changed files with 147 additions and 31 deletions

View File

@@ -139,6 +139,11 @@ def bind_default_badges(path):
'uploaded_at': int(os.path.getmtime(real_path)),
})
def clear_stale_invites():
from .db import db
from .util import time_now
db.execute('DELETE FROM "invite_keys" WHERE expires_at < ?', time_now())
def clear_stale_sessions():
from .db import db
with db.transaction():
@@ -234,6 +239,7 @@ def create_app():
clear_stale_sessions()
clear_api_limits()
clear_stale_invites()
reparse_babycode()