From 821db3cb1a67c20a968ac1dd8ecc4263e511cf16 Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 19 Feb 2025 23:23:24 +0100 Subject: [PATCH] Changed server. --- compose.yml | 2 +- src/snek/app.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 17bcf22..0a42856 100644 --- a/compose.yml +++ b/compose.yml @@ -9,7 +9,7 @@ services: environment: - PYTHONDONTWRITEBYTECODE=1 - PYTHONUNBUFFERED=1 - entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"] + entrypoint: ["gunicorn", "-w", "4", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"] #entrypoint: ["python","-m","snek.app"] snecssh: build: diff --git a/src/snek/app.py b/src/snek/app.py index 0fc1016..8a3481e 100644 --- a/src/snek/app.py +++ b/src/snek/app.py @@ -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__":