Commit 0a74602d authored by BaiJiangJie's avatar BaiJiangJie

[Update] 修改设置 LDAP 同步任务在任务外部设置running状态

parent 05e7311b
......@@ -186,6 +186,8 @@ class LDAPUserListApi(generics.ListAPIView):
sync_util = LDAPSyncUtil()
# 还没有同步任务
if sync_util.task_no_start:
# 任务外部设置 task running 状态
sync_util.set_task_status(sync_util.TASK_STATUS_IS_RUNNING)
task = sync_ldap_user_task.delay()
data = {'msg': 'Cache no data, sync task {} started.'.format(task.id)}
return Response(data=data, status=409)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment