fix: call init_db() at module level so rate_limits table is created under gunicorn

This commit is contained in:
ComputerTech 2026-04-06 19:18:28 +01:00
parent 636d4c919e
commit cc9b184277
1 changed files with 4 additions and 1 deletions

5
app.py
View File

@ -550,8 +550,11 @@ def gone(error):
# ── Entry point ───────────────────────────────────────────────────────────────
# Always initialise the DB when the module is imported (works under Gunicorn
# and other WSGI servers that import app directly, not just via wsgi.py).
init_db()
if __name__ == '__main__':
init_db()
app.run(
debug=_server.get('debug', False),
host=_server.get('host', '0.0.0.0'),