mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2024-09-20 15:05:56 +08:00
worker change
This commit is contained in:
parent
3f0f31fc68
commit
955fe2ad1f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue