Improve command shutdown on context cancellation

This commit is contained in:
Michael Eischer
2024-04-22 22:31:38 +02:00
parent 910927670f
commit 31624aeffd
17 changed files with 80 additions and 6 deletions
+2 -3
View File
@@ -117,9 +117,8 @@ func runStats(ctx context.Context, opts StatsOptions, gopts GlobalOptions, args
return fmt.Errorf("error walking snapshot: %v", err)
}
}
if err != nil {
return err
if ctx.Err() != nil {
return ctx.Err()
}
if opts.countMode == countModeRawData {