aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorAleksey Kosov <rusyak777@list.ru>2025-05-22 19:46:49 +0300
committerGitHub <noreply@github.com>2025-05-22 09:46:49 -0700
commit165af32d6b738daa14b84fb6e3c8891f4b46135b (patch)
tree7e6128d2fda753abc031c6461ae9709b284afcdf /weed/command
parent5182d46e22d2458b16f1f2fb0358f6b5f3e18b5d (diff)
downloadseaweedfs-165af32d6b738daa14b84fb6e3c8891f4b46135b.tar.xz
seaweedfs-165af32d6b738daa14b84fb6e3c8891f4b46135b.zip
added context to filer_client method calls (#6808)
Co-authored-by: akosov <a.kosov@kryptonite.ru>
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_cat.go2
-rw-r--r--weed/command/filer_copy.go4
-rw-r--r--weed/command/filer_remote_gateway_buckets.go3
-rw-r--r--weed/command/filer_remote_sync_dir.go2
-rw-r--r--weed/command/mount_std.go2
5 files changed, 7 insertions, 6 deletions
diff --git a/weed/command/filer_cat.go b/weed/command/filer_cat.go
index ba3625b0d..2c0f84ddc 100644
--- a/weed/command/filer_cat.go
+++ b/weed/command/filer_cat.go
@@ -102,7 +102,7 @@ func runFilerCat(cmd *Command, args []string) bool {
Name: name,
Directory: dir,
}
- respLookupEntry, err := filer_pb.LookupEntry(client, request)
+ respLookupEntry, err := filer_pb.LookupEntry(context.Background(), client, request)
if err != nil {
return err
}
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 9b195e4e8..547e46c4f 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -394,7 +394,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
},
}
- if err := filer_pb.CreateEntry(client, request); err != nil {
+ if err := filer_pb.CreateEntry(context.Background(), client, request); err != nil {
return fmt.Errorf("update fh: %v", err)
}
return nil
@@ -511,7 +511,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,
},
}
- if err := filer_pb.CreateEntry(client, request); err != nil {
+ if err := filer_pb.CreateEntry(context.Background(), client, request); err != nil {
return fmt.Errorf("update fh: %v", err)
}
return nil
diff --git a/weed/command/filer_remote_gateway_buckets.go b/weed/command/filer_remote_gateway_buckets.go
index f6fe9a99c..aa3869171 100644
--- a/weed/command/filer_remote_gateway_buckets.go
+++ b/weed/command/filer_remote_gateway_buckets.go
@@ -1,6 +1,7 @@
package command
import (
+ "context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@@ -408,7 +409,7 @@ func (option *RemoteGatewayOptions) collectRemoteStorageConf() (err error) {
option.remoteConfs = make(map[string]*remote_pb.RemoteConf)
var lastConfName string
- err = filer_pb.List(option, filer.DirectoryEtcRemote, "", func(entry *filer_pb.Entry, isLast bool) error {
+ err = filer_pb.List(context.Background(), option, filer.DirectoryEtcRemote, "", func(entry *filer_pb.Entry, isLast bool) error {
if !strings.HasSuffix(entry.Name, filer.REMOTE_STORAGE_CONF_SUFFIX) {
return nil
}
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go
index 186523e45..c85ba03af 100644
--- a/weed/command/filer_remote_sync_dir.go
+++ b/weed/command/filer_remote_sync_dir.go
@@ -230,7 +230,7 @@ func collectLastSyncOffset(filerClient filer_pb.FilerClient, grpcDialOption grpc
// 3. directory creation time
var lastOffsetTs time.Time
if timeAgo == 0 {
- mountedDirEntry, err := filer_pb.GetEntry(filerClient, util.FullPath(mountedDir))
+ mountedDirEntry, err := filer_pb.GetEntry(context.Background(), filerClient, util.FullPath(mountedDir))
if err != nil {
glog.V(0).Infof("get mounted directory %s: %v", mountedDir, err)
return time.Now()
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index f00daba8a..631091e80 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -255,7 +255,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
// create mount root
mountRootPath := util.FullPath(mountRoot)
mountRootParent, mountDir := mountRootPath.DirAndName()
- if err = filer_pb.Mkdir(seaweedFileSystem, mountRootParent, mountDir, nil); err != nil {
+ if err = filer_pb.Mkdir(context.Background(), seaweedFileSystem, mountRootParent, mountDir, nil); err != nil {
fmt.Printf("failed to create dir %s on filer %s: %v\n", mountRoot, filerAddresses, err)
return false
}