Return error for RunSyncer()

This commit is contained in:
Yang Luo
2023-08-27 02:08:45 +08:00
parent 7e3c361ce7
commit 988b26b3c2
7 changed files with 74 additions and 51 deletions

View File

@ -52,11 +52,14 @@ func addSyncerJob(syncer *Syncer) error {
syncer.initAdapter()
syncer.syncUsers()
err := syncer.syncUsers()
if err != nil {
return err
}
schedule := fmt.Sprintf("@every %ds", syncer.SyncInterval)
cron := getCronMap(syncer.Name)
_, err := cron.AddFunc(schedule, syncer.syncUsers)
_, err = cron.AddFunc(schedule, syncer.syncUsersNoError)
if err != nil {
return err
}