chore: downgrade log level for auto backup disable (#2454)

downgrade log level for auto backup disable
This commit is contained in:
Athurg Gooth 2023-10-27 23:25:51 +08:00 committed by GitHub
parent 1b34119e60
commit 20d3abb99a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()