Use global context in cmd_forget, like all other cmds

This commit is contained in:
Pauline Middelink 2017-05-04 16:35:35 +02:00
parent db6541b24c
commit 02eafe94b3
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ func runForget(opts ForgetOptions, gopts GlobalOptions, args []string) error {
} }
snapshotGroups := make(map[string]restic.Snapshots) snapshotGroups := make(map[string]restic.Snapshots)
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(gopts.ctx)
defer cancel() defer cancel()
for sn := range FindFilteredSnapshots(ctx, repo, opts.Host, opts.Tags, opts.Paths, args) { for sn := range FindFilteredSnapshots(ctx, repo, opts.Host, opts.Tags, opts.Paths, args) {
if len(args) > 0 { if len(args) > 0 {