2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-02 19:49:44 +00:00

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

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 {