mirror of
https://github.com/restic/restic.git
synced 2024-12-23 00:07:25 +00:00
mount: Only remember successful snapshot refreshes
If the context provided by the fuse library is canceled before the index was loaded this could lead to missing snapshots.
This commit is contained in:
parent
4cccffab58
commit
522406b4f0
1 changed files with 2 additions and 3 deletions
|
@ -280,9 +280,8 @@ func (d *SnapshotsDirStructure) updateSnapshots(ctx context.Context) error {
|
||||||
// sort snapshots ascending by time (default order is descending)
|
// sort snapshots ascending by time (default order is descending)
|
||||||
sort.Sort(sort.Reverse(snapshots))
|
sort.Sort(sort.Reverse(snapshots))
|
||||||
|
|
||||||
d.lastCheck = time.Now()
|
|
||||||
|
|
||||||
if d.snCount == len(snapshots) {
|
if d.snCount == len(snapshots) {
|
||||||
|
d.lastCheck = time.Now()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +290,8 @@ func (d *SnapshotsDirStructure) updateSnapshots(ctx context.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d.lastCheck = time.Now()
|
||||||
d.snCount = len(snapshots)
|
d.snCount = len(snapshots)
|
||||||
|
|
||||||
d.makeDirs(snapshots)
|
d.makeDirs(snapshots)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue