chanbackup: add new updateBackupFile method, write fresh backup on startup
In this commit, we modify the sub-swapper to update the set of backups files time it's tarted. We do this to ensure that each time we start, we're up to sync with the current set of open channels. This also ensure that we'll create a new back up file if this is the first time we're starting up with this new feature.
This commit is contained in:
3 files changed
+67
-39
No files matched your search
@@ -76,6 +76,8 @@ func (b *MultiFile) UpdateAndSwap(newBackup PackedMulti) error {
|
||||
return ErrNoBackupFileExists
|
||||
}
|
||||
|
||||
log.Infof("Updating backup file at %v", b.fileName)
|
||||
|
||||
// If the old back up file still exists, then we'll delete it before
|
||||
// proceeding.
|
||||
if _, err := os.Stat(b.tempFileName); err == nil {
|
||||
|
||||
Reference in new issue
Block a user