testing #1

Merged
tema merged 2 commits from testing into master 2022-10-12 23:47:42 +03:00
5 changed files with 31 additions and 1 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
./venv/

View File

@ -6,11 +6,12 @@ WORKDIR /usr/src/bot
RUN apk update \
&& apk add \
build-base \
gcc \
gcc git openssh \
musl-dev \
python3-dev \
py3-pip \
postgresql-dev
RUN pip install --no-cache-dir -r requirements.txt
RUN sh ./utils/patch/aiogram-patch-loop.sh
CMD ["python3", "bot.py"]

View File

@ -2,6 +2,8 @@
#google-auth-httplib2
#google-auth-oauthlib
bs4
requests
GitPython
lxml
peewee
aiogram

View File

@ -0,0 +1,20 @@
--- executor.py 2022-10-12 22:22:11.820907568 +0300
+++ executor.py.1 2022-10-12 22:23:26.660883642 +0300
@@ -105,7 +105,7 @@
check_ip=check_ip,
retry_after=retry_after,
route_name=route_name)
- executor.run_app(**kwargs)
+ executor.run_app(loop=loop, **kwargs)
def start(dispatcher, future, *, loop=None, skip_updates=None,
@@ -303,6 +303,8 @@
:return:
"""
self.set_webhook(webhook_path=webhook_path, request_handler=request_handler, route_name=route_name)
+ if "loop" not in kwargs:
+ kwargs["loop"] = self.loop
self.run_app(**kwargs)
def start_polling(self, reset_webhook=None, timeout=20, relax=0.1, fast=True,

View File

@ -0,0 +1,6 @@
#!/bin/sh
#https://github.com/aiogram/aiogram/pull/795
PYTHON_LIB_PATH=$(python3 -c 'import sys; print(sys.path[4])')
patch --directory=$PYTHON_LIB_PATH/aiogram/utils/ -i $(pwd)/utils/patch/aiogram-loop.patch