fixed: 定时任务的执行时机

This commit is contained in:
xxx 2023-11-15 09:22:01 +08:00
parent 5dcde4f911
commit e8399362ea

View File

@ -33,17 +33,17 @@ public class LDAPSchedule {
@Scheduled(fixedRate = 3600000) @Scheduled(fixedRate = 3600000)
public void sync() { public void sync() {
if (!ldapBus.enabledLDAP()) {
log.info("未配置LDAP服务");
return;
}
// 系统刚启动不执行 // 系统刚启动不执行
if (times == 0) { if (times == 0) {
times++; times++;
return; return;
} }
if (!ldapBus.enabledLDAP()) {
log.info("未配置LDAP服务");
return;
}
try { try {
ldapBus.departmentSync(); ldapBus.departmentSync();
} catch (Exception e) { } catch (Exception e) {