Start the progress reporter once per snapshot, not once per path (closes #253)
check / check (push) Successful in 19m54s
check / check (push) Successful in 19m54s
A backup without --cron of a snapshot with two or more paths panicked with "close of closed channel". Scan runs once per path, and it started the progress reporter and deferred its Stop each time; Stop closes the reporter's signal channel, so the second path's Stop panicked. scanAllDirectories now starts the reporter before the first path and stops it after the last, and Scan no longer starts or stops it. A new test backs up a two-path snapshot with the reporter on and restores both paths. Model: opus-5-5
This commit was merged in pull request #255.
This commit is contained in:
@@ -281,6 +281,11 @@ func (v *Vaultik) resolveSnapshotPaths(snapName string) ([]string, error) {
|
||||
func (v *Vaultik) scanAllDirectories(
|
||||
scanner *snapshot.Scanner, resolvedDirs []string, snapshotID string,
|
||||
) (*snapshotStats, error) {
|
||||
if progress := scanner.GetProgress(); progress != nil {
|
||||
progress.Start()
|
||||
defer progress.Stop()
|
||||
}
|
||||
|
||||
stats := &snapshotStats{}
|
||||
|
||||
for i, dir := range resolvedDirs {
|
||||
|
||||
Reference in New Issue
Block a user