Skip to content

Commit b081d3d

Browse files
committed
chore: 修改cron运行判断逻辑
1 parent 11f313f commit b081d3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ func main() {
143143
log.Fatalf("load config error: %s", err.Error())
144144
}
145145

146-
runBackupTask(conf)
147146
if conf.Cron != "" {
148147
task := cron.New()
149148
_, e := task.AddFunc(conf.Cron, func() {
@@ -153,5 +152,7 @@ func main() {
153152
log.Fatalf("add cron task error: %s", e.Error())
154153
}
155154
task.Run()
155+
} else {
156+
runBackupTask(conf)
156157
}
157158
}

0 commit comments

Comments
 (0)