fix: call init_db() at module level so rate_limits table is created under gunicorn
This commit is contained in:
parent
636d4c919e
commit
cc9b184277
5
app.py
5
app.py
|
|
@ -550,8 +550,11 @@ def gone(error):
|
||||||
|
|
||||||
# ── Entry point ───────────────────────────────────────────────────────────────
|
# ── 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__':
|
if __name__ == '__main__':
|
||||||
init_db()
|
|
||||||
app.run(
|
app.run(
|
||||||
debug=_server.get('debug', False),
|
debug=_server.get('debug', False),
|
||||||
host=_server.get('host', '0.0.0.0'),
|
host=_server.get('host', '0.0.0.0'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue