aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@uber.com>2019-03-15 17:20:24 -0700
committerChris Lu <chris.lu@uber.com>2019-03-15 17:20:24 -0700
commit55bab1b456c3c13a8009a11730e678ca0c48dfb0 (patch)
treec7609b465c8444fc7538cb7f9392011840e1b38c /weed/filesys/wfs.go
parentcece860bfde443d4f8cddb04b10fb98a998995ed (diff)
downloadseaweedfs-55bab1b456c3c13a8009a11730e678ca0c48dfb0.tar.xz
seaweedfs-55bab1b456c3c13a8009a11730e678ca0c48dfb0.zip
add context.Context
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index f7383582d..f8be24e5e 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -73,9 +73,9 @@ func (wfs *WFS) Root() (fs.Node, error) {
return &Dir{Path: wfs.option.FilerMountRootPath, wfs: wfs}, nil
}
-func (wfs *WFS) withFilerClient(fn func(filer_pb.SeaweedFilerClient) error) error {
+func (wfs *WFS) withFilerClient(ctx context.Context, fn func(filer_pb.SeaweedFilerClient) error) error {
- return util.WithCachedGrpcClient(func(grpcConnection *grpc.ClientConn) error {
+ return util.WithCachedGrpcClient(ctx, func(grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
return fn(client)
}, wfs.option.FilerGrpcAddress, wfs.option.GrpcDialOption)
@@ -133,7 +133,7 @@ func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.
if wfs.stats.lastChecked < time.Now().Unix()-20 {
- err := wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
+ err := wfs.withFilerClient(ctx, func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.StatisticsRequest{
Collection: wfs.option.Collection,