diff options
| author | Aleksey Kosov <rusyak777@list.ru> | 2025-05-22 19:46:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-22 09:46:49 -0700 |
| commit | 165af32d6b738daa14b84fb6e3c8891f4b46135b (patch) | |
| tree | 7e6128d2fda753abc031c6461ae9709b284afcdf /weed/s3api/filer_util.go | |
| parent | 5182d46e22d2458b16f1f2fb0358f6b5f3e18b5d (diff) | |
| download | seaweedfs-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/s3api/filer_util.go')
| -rw-r--r-- | weed/s3api/filer_util.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/weed/s3api/filer_util.go b/weed/s3api/filer_util.go index 8ae8f780a..38400140f 100644 --- a/weed/s3api/filer_util.go +++ b/weed/s3api/filer_util.go @@ -11,19 +11,19 @@ import ( func (s3a *S3ApiServer) mkdir(parentDirectoryPath string, dirName string, fn func(entry *filer_pb.Entry)) error { - return filer_pb.Mkdir(s3a, parentDirectoryPath, dirName, fn) + return filer_pb.Mkdir(context.Background(), s3a, parentDirectoryPath, dirName, fn) } func (s3a *S3ApiServer) mkFile(parentDirectoryPath string, fileName string, chunks []*filer_pb.FileChunk, fn func(entry *filer_pb.Entry)) error { - return filer_pb.MkFile(s3a, parentDirectoryPath, fileName, chunks, fn) + return filer_pb.MkFile(context.Background(), s3a, parentDirectoryPath, fileName, chunks, fn) } func (s3a *S3ApiServer) list(parentDirectoryPath, prefix, startFrom string, inclusive bool, limit uint32) (entries []*filer_pb.Entry, isLast bool, err error) { - err = filer_pb.List(s3a, parentDirectoryPath, prefix, func(entry *filer_pb.Entry, isLastEntry bool) error { + err = filer_pb.List(context.Background(), s3a, parentDirectoryPath, prefix, func(entry *filer_pb.Entry, isLastEntry bool) error { entries = append(entries, entry) if isLastEntry { isLast = true @@ -76,19 +76,19 @@ func doDeleteEntry(client filer_pb.SeaweedFilerClient, parentDirectoryPath strin func (s3a *S3ApiServer) exists(parentDirectoryPath string, entryName string, isDirectory bool) (exists bool, err error) { - return filer_pb.Exists(s3a, parentDirectoryPath, entryName, isDirectory) + return filer_pb.Exists(context.Background(), s3a, parentDirectoryPath, entryName, isDirectory) } func (s3a *S3ApiServer) touch(parentDirectoryPath string, entryName string, entry *filer_pb.Entry) (err error) { - return filer_pb.Touch(s3a, parentDirectoryPath, entryName, entry) + return filer_pb.Touch(context.Background(), s3a, parentDirectoryPath, entryName, entry) } func (s3a *S3ApiServer) getEntry(parentDirectoryPath, entryName string) (entry *filer_pb.Entry, err error) { fullPath := util.NewFullPath(parentDirectoryPath, entryName) - return filer_pb.GetEntry(s3a, fullPath) + return filer_pb.GetEntry(context.Background(), s3a, fullPath) } func (s3a *S3ApiServer) updateEntry(parentDirectoryPath string, newEntry *filer_pb.Entry) error { @@ -98,7 +98,7 @@ func (s3a *S3ApiServer) updateEntry(parentDirectoryPath string, newEntry *filer_ } err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { - err := filer_pb.UpdateEntry(client, updateEntryRequest) + err := filer_pb.UpdateEntry(context.Background(), client, updateEntryRequest) if err != nil { return err } |
