Skip to content

Commit 6445f3e

Browse files
authored
Merge pull request #1158 from elliott-logrocket/error-on-watch-when-keep-local-is-negative
Fixes erroneous error when backup_to_keep_local=-1
2 parents 1fde657 + a87c06a commit 6445f3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/backup/watch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (b *Backuper) Watch(watchInterval, fullInterval, watchBackupNameTemplate, t
179179

180180
}
181181

182-
if createRemoteErrCount > b.cfg.General.BackupsToKeepRemote || deleteLocalErrCount > b.cfg.General.BackupsToKeepLocal {
182+
if createRemoteErrCount > b.cfg.General.BackupsToKeepRemote || deleteLocalErrCount > b.cfg.General.BackupsToKeepLocal && b.cfg.General.BackupsToKeepLocal >= 0 {
183183
return fmt.Errorf("too many errors create_remote: %d, delete local: %d, during watch full_interval: %s, abort watching", createRemoteErrCount, deleteLocalErrCount, b.cfg.General.FullInterval)
184184
}
185185
if (createRemoteErr != nil || deleteLocalErr != nil) && time.Now().Sub(lastFullBackup) > b.cfg.General.FullDuration {

0 commit comments

Comments
 (0)