diff --git a/server/service/backup/backup.go b/server/service/backup/backup.go index b11da7cf..399d586d 100644 --- a/server/service/backup/backup.go +++ b/server/service/backup/backup.go @@ -32,11 +32,16 @@ func (r *BackupRunner) Run(ctx context.Context) { } interval, err := strconv.Atoi(intervalStr) - if err != nil || interval <= 0 { + if err != nil || interval < 0 { log.Error(fmt.Sprintf("invalid SystemSettingAutoBackupIntervalName value %s, disable auto backup", intervalStr), zap.Error(err)) return } + if interval == 0 { + println("AutoBackupIntervalName value is 0, disable auto backup") + return + } + log.Info("enable auto backup every " + intervalStr + " seconds") ticker := time.NewTicker(time.Duration(interval) * time.Second) defer ticker.Stop()