dynamic worker name

This commit is contained in:
BennyThink 2021-12-30 19:03:21 +08:00
parent 4f78eeef15
commit 73cb33a831
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481

View File

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