Updated asyncio debugging.
This commit is contained in:
parent
c745f60997
commit
3ccbe8be5c
@ -9,8 +9,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- PYTHONDONTWRITEBYTECODE="1"
|
- PYTHONDONTWRITEBYTECODE="1"
|
||||||
- PYTHONUNBUFFERED="1"
|
- PYTHONUNBUFFERED="1"
|
||||||
entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
#entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
||||||
#["python","-m","snek.app"]
|
entrypoint: ["python","-m","snek.app"]
|
||||||
snecssh:
|
snecssh:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
import asyncio
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from aiohttp_session import (
|
from aiohttp_session import (
|
||||||
get_session as session_get,
|
get_session as session_get,
|
||||||
@ -29,6 +31,7 @@ from snek.view.web import WebView
|
|||||||
from snek.view.upload import UploadView
|
from snek.view.upload import UploadView
|
||||||
from snek.view.search_user import SearchUserView
|
from snek.view.search_user import SearchUserView
|
||||||
|
|
||||||
|
|
||||||
SESSION_KEY = b"c79a0c5fda4b424189c427d28c9f7c34"
|
SESSION_KEY = b"c79a0c5fda4b424189c427d28c9f7c34"
|
||||||
|
|
||||||
|
|
||||||
@ -121,8 +124,11 @@ class Application(BaseApplication):
|
|||||||
return await super().render_template(template, request, context)
|
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__":
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(main())
|
||||||
web.run_app(app, port=8081, host="0.0.0.0")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user