Updated asyncio debugging.

This commit is contained in:
retoor 2025-02-18 12:28:49 +01:00
parent c745f60997
commit 3ccbe8be5c
2 changed files with 11 additions and 5 deletions

View File

@ -9,8 +9,8 @@ services:
environment:
- PYTHONDONTWRITEBYTECODE="1"
- PYTHONUNBUFFERED="1"
entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
#["python","-m","snek.app"]
#entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
entrypoint: ["python","-m","snek.app"]
snecssh:
build:
context: .

View File

@ -1,5 +1,7 @@
import pathlib
import asyncio
from aiohttp import web
from aiohttp_session import (
get_session as session_get,
@ -29,6 +31,7 @@ from snek.view.web import WebView
from snek.view.upload import UploadView
from snek.view.search_user import SearchUserView
SESSION_KEY = b"c79a0c5fda4b424189c427d28c9f7c34"
@ -121,8 +124,11 @@ 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")
loop = asyncio.get_event_loop()
loop.set_debug(True)
await web._run_app(app, port=8081, host="0.0.0.0")
if __name__ == "__main__":
web.run_app(app, port=8081, host="0.0.0.0")
asyncio.run(main())