mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2024-09-20 23:15:57 +08:00
worker count and hot patch
This commit is contained in:
parent
d82361f940
commit
6d4b568b19
|
@ -343,7 +343,7 @@ def hot_patch(*args):
|
|||
def run_celery():
|
||||
argv = [
|
||||
"-A", "tasks", 'worker', '--loglevel=info',
|
||||
"--pool=threads", f"--concurrency={WORKERS * 2}",
|
||||
"--pool=threads", f"--concurrency={WORKERS}",
|
||||
"-n", os.getenv("WORKER_NAME", "")
|
||||
]
|
||||
app.worker_main(argv)
|
||||
|
|
|
@ -138,8 +138,8 @@ def patch_handler(client: "Client", message: "types.Message"):
|
|||
if username == OWNER:
|
||||
celery_app.control.broadcast("hot_patch")
|
||||
client.send_chat_action(chat_id, "typing")
|
||||
client.send_message(chat_id, "Oorah!")
|
||||
hot_patch()
|
||||
client.send_message(chat_id, "Oorah!")
|
||||
|
||||
|
||||
@app.on_message(filters.command(["ping"]))
|
||||
|
|
Loading…
Reference in a new issue