forked from retoor/snek
fix: move Application instantiation to module level and increase gunicorn workers to 4
Move the `Application` instance creation from inside the async `main()` function to module scope in `src/snek/app.py`, ensuring the app object is available at import time for gunicorn's worker initialization. In `compose.yml`, increase the gunicorn worker count from 1 to 4 to improve concurrent request handling under the aiohttp worker class.
This commit is contained in:
+3
-1
@@ -127,8 +127,10 @@ class Application(BaseApplication):
|
||||
return await super().render_template(template, request, context)
|
||||
|
||||
|
||||
|
||||
app = Application(db_path="sqlite:///snek.db")
|
||||
|
||||
async def main():
|
||||
app = Application(db_path="sqlite:///snek.db")
|
||||
await web._run_app(app, port=8081, host="0.0.0.0")
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user