diff --git a/apps/users/tasks.py b/apps/users/tasks.py index eb3ec8b9f..6d9bac660 100644 --- a/apps/users/tasks.py +++ b/apps/users/tasks.py @@ -112,6 +112,9 @@ def import_ldap_user_periodic(): else: interval = None crontab = settings.AUTH_LDAP_SYNC_CRONTAB + if crontab: + # 优先使用 crontab + interval = None tasks = { task_name: { 'task': import_ldap_user.name,