mirror of
https://github.com/rclone/rclone.git
synced 2025-06-05 12:00:19 +08:00
Add context propagation to rclone
- Change rclone/fs interfaces to accept context.Context - Update interface implementations to use context.Context - Change top level usage to propagate context to lover level functions Context propagation is needed for stopping transfers and passing other request-scoped values.
This commit is contained in:

committed by
Nick Craig-Wood

parent
a2c317b46e
commit
f78cd1e043
@ -1,6 +1,8 @@
|
||||
package delete
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ncw/rclone/cmd"
|
||||
"github.com/ncw/rclone/fs/operations"
|
||||
"github.com/spf13/cobra"
|
||||
@ -39,7 +41,7 @@ delete all files bigger than 100MBytes.
|
||||
cmd.CheckArgs(1, 1, command, args)
|
||||
fsrc := cmd.NewFsSrc(args)
|
||||
cmd.Run(true, false, command, func() error {
|
||||
return operations.Delete(fsrc)
|
||||
return operations.Delete(context.Background(), fsrc)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user