Add queue to file server tasks

This commit is contained in:
Jan Dittberner 2023-05-07 14:41:56 +02:00
parent 27e9d27b2b
commit 175ffd19f4

View file

@ -157,22 +157,25 @@ def handle_user_created(sender, instance, created, **kwargs):
""" """
if created: if created:
chain = ( task_ldap_1 = create_ldap_user.s(
create_ldap_user.s( instance.username,
instance.username, instance.uid,
instance.uid, instance.group.gid,
instance.group.gid, instance.gecos,
instance.gecos, instance.homedir,
instance.homedir, instance.shell,
instance.shell, None,
None, ).set(queue="ldap")
) task_file_1 = setup_file_sftp_userdir_chained.s().set(queue="file")
| setup_file_sftp_userdir_chained.s() task_file_2 = setup_file_mail_userdir_chained.s().set(queue="file")
| (setup_file_mail_userdir_chained.s())
chain = task_ldap_1 | task_file_1 | task_file_2
task_result = TaskResult.objects.create_task_result(
"handle_user_created", chain
) )
taskresult = TaskResult.objects.create_task_result("handle_user_created", chain)
_LOGGER.info( _LOGGER.info(
"LDAP user creation has been requested in task %s", taskresult.task_id "LDAP user creation has been requested in task %s", task_result.task_id
) )
_LOGGER.debug("user %s has been %s", instance, created and "created" or "updated") _LOGGER.debug("user %s has been %s", instance, created and "created" or "updated")