root: fix celery task ID not being included in log

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-12-09 09:36:52 +01:00
parent 26b35c9b7b
commit 1ed2bddba7
2 changed files with 4 additions and 2 deletions

View File

@ -43,9 +43,9 @@ def after_task_publish_hook(sender=None, headers=None, body=None, **kwargs):
# pylint: disable=unused-argument
@task_prerun.connect
def task_prerun_hook(task_id, task, *args, **kwargs):
def task_prerun_hook(task_id: str, task, *args, **kwargs):
"""Log task_id on worker"""
request_id = "task-" + uuid4().hex[5:]
request_id = "task-" + task_id.replace("-", "")
LOCAL.authentik_task = {
"request_id": request_id,
}