Skip to content

Commit

Permalink
cover more stale vss cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Nov 4, 2024
1 parent bee4f44 commit da0c208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/agent/snapshots/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ func Snapshot(driveLetter string) (*WinVSSSnapshot, error) {
for _, knownSnap := range KnownSnapshots {
if knownSnap.SnapshotPath == snapshotPath && time.Since(knownSnap.LastAccessed) < time.Hour {
return knownSnap, nil
} else {
} else if time.Since(knownSnap.LastAccessed) >= time.Hour {
knownSnap.Close()
break
}
}
}
_ = vss.Remove(snapshotPath)
}

_ = os.Remove(snapshotPath)
Expand Down

0 comments on commit da0c208

Please sign in to comment.