worker count and hot patch

This commit is contained in:
BennyThink 2022-02-10 15:47:06 +08:00
parent d82361f940
commit 6d4b568b19
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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"]))