Add queue information to user delete task chain

This commit is contained in:
Jan Dittberner 2023-05-07 14:47:30 +02:00
parent 175ffd19f4
commit 8c7af9a246

View file

@ -338,14 +338,17 @@ def handle_user_deleted(sender, instance, **kwargs):
} }
""" """
chain = ( file_task_1 = delete_file_mail_userdir.s(instance.username).set(queue="file")
delete_file_mail_userdir.s(instance.username) file_task_2 = delete_file_sftp_userdir_chained.s().set(queue="file")
| delete_file_sftp_userdir_chained.s() ldap_task_1 = delete_ldap_user_chained.s().set(queue="ldap")
| delete_ldap_user_chained.s()
) chain = file_task_1 | file_task_2 | ldap_task_1
_LOGGER.debug("chain signature %s", chain) _LOGGER.debug("chain signature %s", chain)
taskresult = TaskResult.objects.create_task_result("handle_user_deleted", chain) task_result = TaskResult.objects.create_task_result("handle_user_deleted", chain)
_LOGGER.info("LDAP user deletion has been requested in task %s", taskresult.task_id)
_LOGGER.info(
"LDAP user deletion has been requested in task %s", task_result.task_id
)
@receiver(post_delete, sender=AdditionalGroup) @receiver(post_delete, sender=AdditionalGroup)