mirror of
https://github.com/restic/restic.git
synced 2026-11-05 23:09:22 +00:00
Improve command shutdown on context cancellation
This commit is contained in:
1 parent
910927670f
commit
31624aeffd
17 files changed
+80
-6
No files matched your search
@@ -608,6 +608,9 @@ func runFind(ctx context.Context, opts FindOptions, gopts GlobalOptions, args []
|
||||
for sn := range FindFilteredSnapshots(ctx, snapshotLister, repo, &opts.SnapshotFilter, opts.Snapshots) {
|
||||
filteredSnapshots = append(filteredSnapshots, sn)
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
sort.Slice(filteredSnapshots, func(i, j int) bool {
|
||||
return filteredSnapshots[i].Time.Before(filteredSnapshots[j].Time)
|
||||
|
||||
Reference in new issue
Block a user