Change syncer.SyncInterval to second-level.

This commit is contained in:
Gucheng Wang
2022-01-17 15:59:55 +08:00
parent f24d9ae251
commit d183b9eca9
6 changed files with 21 additions and 21 deletions

View File

@ -166,14 +166,14 @@ func RunSyncUsersJob() {
syncer.syncUsers()
// run at every minute
//schedule := fmt.Sprintf("* * * * %d", syncer.SyncInterval)
schedule := "* * * * *"
ctab := getCrontab(syncer.Name)
err := ctab.AddJob(schedule, syncer.syncUsers)
schedule := fmt.Sprintf("@every %ds", syncer.SyncInterval)
cron := getCronMap(syncer.Name)
_, err := cron.AddFunc(schedule, syncer.syncUsers)
if err != nil {
panic(err)
}
cron.Start()
}
time.Sleep(time.Duration(1<<63 - 1))