mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
changed to gunicorn
This commit is contained in:
parent
a53153f1ef
commit
21db4c2272
@ -66,9 +66,14 @@ async def webhook(request: web.Request) -> web.Response:
|
||||
return web.Response(status=HTTPStatus.OK)
|
||||
|
||||
|
||||
async def on_startup_gunicorn(app: web.Application) -> None:
|
||||
await dispatcher.bot.set_webhook(WEBHOOK_URL)
|
||||
|
||||
|
||||
async def create_app() -> web.Application:
|
||||
application = web.Application()
|
||||
application.router.add_post('/', webhook)
|
||||
application.on_startup.append(on_startup_gunicorn)
|
||||
return application
|
||||
|
||||
|
||||
|
@ -4,4 +4,4 @@
|
||||
echo "starting the bot"
|
||||
cd /opt/mosgortrans \
|
||||
&& source /home/balsh/.cache/pypoetry/virtualenvs/mosgortrans-3eZxMcY3-py3.10/bin/activate \
|
||||
&& gunicorn app.main:create_app --bind prod-server.lan:8084 --reload --worker-class aiohttp.GunicornWebWorker
|
||||
&& gunicorn app.main:create_app --bind prod-server.lan:8084 --worker-class aiohttp.GunicornWebWorker
|
Loading…
x
Reference in New Issue
Block a user