aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_du.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-01-26 14:42:11 -0800
committerChris Lu <chris.lu@gmail.com>2020-01-26 14:42:11 -0800
commit72a64a5cf8c2a5adfe59665a746e013ca948e681 (patch)
treea0fd30cd09d5f6f5a4f8031818f1b12bf7b85f4f /weed/shell/command_fs_du.go
parent0c298ef8906816b40b19db36be673af564af032a (diff)
downloadseaweedfs-72a64a5cf8c2a5adfe59665a746e013ca948e681.tar.xz
seaweedfs-72a64a5cf8c2a5adfe59665a746e013ca948e681.zip
use the same context object in order to retry
Diffstat (limited to 'weed/shell/command_fs_du.go')
-rw-r--r--weed/shell/command_fs_du.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index 2c46350b2..d6ea51d0c 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -82,12 +82,12 @@ func duTraverseDirectory(ctx context.Context, writer io.Writer, filerClient file
return
}
-func (env *CommandEnv) withFilerClient(ctx context.Context, filerServer string, filerPort int64, fn func(filer_pb.SeaweedFilerClient) error) error {
+func (env *CommandEnv) withFilerClient(ctx context.Context, filerServer string, filerPort int64, fn func(context.Context, filer_pb.SeaweedFilerClient) error) error {
filerGrpcAddress := fmt.Sprintf("%s:%d", filerServer, filerPort+10000)
- return util.WithCachedGrpcClient(ctx, func(grpcConnection *grpc.ClientConn) error {
+ return util.WithCachedGrpcClient(ctx, func(ctx2 context.Context, grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
- return fn(client)
+ return fn(ctx2, client)
}, filerGrpcAddress, env.option.GrpcDialOption)
}
@@ -105,6 +105,6 @@ func (env *CommandEnv) getFilerClient(filerServer string, filerPort int64) *comm
filerPort: filerPort,
}
}
-func (c *commandFilerClient) WithFilerClient(ctx context.Context, fn func(filer_pb.SeaweedFilerClient) error) error {
+func (c *commandFilerClient) WithFilerClient(ctx context.Context, fn func(context.Context, filer_pb.SeaweedFilerClient) error) error {
return c.env.withFilerClient(ctx, c.filerServer, c.filerPort, fn)
}