Skip to content

Commit

Permalink
chore: 修改cron运行判断逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Sep 16, 2024
1 parent 11f313f commit b081d3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func main() {
log.Fatalf("load config error: %s", err.Error())
}

runBackupTask(conf)
if conf.Cron != "" {
task := cron.New()
_, e := task.AddFunc(conf.Cron, func() {
Expand All @@ -153,5 +152,7 @@ func main() {
log.Fatalf("add cron task error: %s", e.Error())
}
task.Run()
} else {
runBackupTask(conf)
}
}

0 comments on commit b081d3d

Please sign in to comment.