run commands in ThreadPool

This commit is contained in:
2023-04-08 14:49:46 +03:00
parent 3ea5b0c1ee
commit 031a7fade7
8 changed files with 74 additions and 57 deletions

View File

@@ -2,9 +2,16 @@
echo "starting the bot"
gunicorn main:create_app \
--bind 0.0.0.0:8084 \
--worker-class aiohttp.GunicornWebWorker \
--timeout 150 \
--max-requests 2000 \
--max-requests-jitter 400
if [[ "${START_WITH_WEBHOOK}" == "true" ]]
then
echo "Starting bot in webhook mode..."
gunicorn main:create_app \
--bind ${WEBAPP_HOST}:${WEBAPP_PORT} \
--worker-class aiohttp.GunicornWebWorker \
--timeout 150 \
--max-requests 2000 \
--max-requests-jitter 400
else
echo "Starting bot in polling mode..."
python main.py
fi