From 20d3abb99a23cf63ef714577c7a3baa4d3f4e4e0 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Fri, 27 Oct 2023 23:25:51 +0800 Subject: [PATCH] chore: downgrade log level for auto backup disable (#2454) downgrade log level for auto backup disable --- server/service/backup/backup.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()