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
+2
-1
@@ -1,6 +1,7 @@
|
||||
package lsd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"github.com/ncw/rclone/cmd"
|
||||
@@ -52,7 +53,7 @@ If you just want the directory names use "rclone lsf --dirs-only".
|
||||
}
|
||||
fsrc := cmd.NewFsSrc(args)
|
||||
cmd.Run(false, false, command, func() error {
|
||||
return operations.ListDir(fsrc, os.Stdout)
|
||||
return operations.ListDir(context.Background(), fsrc, os.Stdout)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user