From 522406b4f05aaeb2fc9290098b6fce3f39eb2ecf Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 19 Aug 2022 19:05:04 +0200 Subject: [PATCH] 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. --- internal/fuse/snapshots_dirstruct.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/fuse/snapshots_dirstruct.go b/internal/fuse/snapshots_dirstruct.go index 18831dcb1..78188f3dd 100644 --- a/internal/fuse/snapshots_dirstruct.go +++ b/internal/fuse/snapshots_dirstruct.go @@ -280,9 +280,8 @@ func (d *SnapshotsDirStructure) updateSnapshots(ctx context.Context) error { // sort snapshots ascending by time (default order is descending) sort.Sort(sort.Reverse(snapshots)) - d.lastCheck = time.Now() - if d.snCount == len(snapshots) { + d.lastCheck = time.Now() return nil } @@ -291,8 +290,8 @@ func (d *SnapshotsDirStructure) updateSnapshots(ctx context.Context) error { return err } + d.lastCheck = time.Now() d.snCount = len(snapshots) - d.makeDirs(snapshots) return nil }