worker change

This commit is contained in:
BennyThink 2022-02-05 18:43:06 +08:00
parent 3f0f31fc68
commit 955fe2ad1f
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481
3 changed files with 5 additions and 5 deletions

View file

@ -9,13 +9,13 @@ __author__ = "Benny <benny.think@gmail.com>"
from pyrogram import Client
from config import APP_HASH, APP_ID, TOKEN, WORKERS
from config import APP_HASH, APP_ID, TOKEN
def create_app(session="ytdl", workers=WORKERS):
def create_app(session="ytdl", workers=100):
_app = Client(session, APP_ID, APP_HASH,
bot_token=TOKEN, workers=workers,
# proxy={"hostname": "host.docker.internal", "port": 1086}
# proxy={"hostname": "host.docker.internal", "port": 1080}
)
return _app

View file

@ -118,7 +118,7 @@ class VIP(Redis, MySQL):
if href not in ["null", "", None]:
return href
except Exception:
logging.warning("Canonical exception %s soup.find(%s, %s=%s) --> %s", url, tag, kw, v, result)
logging.warning("Canonical exception %s", url)
return url

View file

@ -299,7 +299,7 @@ def run_celery():
argv = [
"-A", "tasks", 'worker', '--loglevel=info',
"--pool=threads", f"--concurrency={WORKERS * 2}",
"-n", f"{os.getenv('WORKER_NAME', '')}"
"-n", os.getenv("WORKER_NAME", "")
]
app.worker_main(argv)