aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/assign_file_id.go
diff options
context:
space:
mode:
authorAleksey Kosov <rusyak777@list.ru>2025-05-28 21:34:02 +0300
committerGitHub <noreply@github.com>2025-05-28 11:34:02 -0700
commit283d9e0079d5deb57aefe9a7b30e8b9869ba8685 (patch)
tree87b09bebed2ee4afc9c2a4f711ac8598fe2949b7 /weed/operation/assign_file_id.go
parent62aaaa18f3ea8b7600d28934580dc220ca95164a (diff)
downloadseaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.tar.xz
seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.zip
Add context with request (#6824)
Diffstat (limited to 'weed/operation/assign_file_id.go')
-rw-r--r--weed/operation/assign_file_id.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go
index 13418da1a..eb54c674b 100644
--- a/weed/operation/assign_file_id.go
+++ b/weed/operation/assign_file_id.go
@@ -139,7 +139,7 @@ func (ap *singleThreadAssignProxy) doAssign(grpcConnection *grpc.ClientConn, pri
return
}
-func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest *VolumeAssignRequest, alternativeRequests ...*VolumeAssignRequest) (*AssignResult, error) {
+func Assign(ctx context.Context, masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest *VolumeAssignRequest, alternativeRequests ...*VolumeAssignRequest) (*AssignResult, error) {
var requests []*VolumeAssignRequest
requests = append(requests, primaryRequest)
@@ -153,7 +153,7 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
continue
}
- lastError = WithMasterServerClient(false, masterFn(context.Background()), grpcDialOption, func(masterClient master_pb.SeaweedClient) error {
+ lastError = WithMasterServerClient(false, masterFn(ctx), grpcDialOption, func(masterClient master_pb.SeaweedClient) error {
req := &master_pb.AssignRequest{
Count: request.Count,
Replication: request.Replication,
@@ -165,7 +165,7 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
DataNode: request.DataNode,
WritableVolumeCount: request.WritableVolumeCount,
}
- resp, grpcErr := masterClient.Assign(context.Background(), req)
+ resp, grpcErr := masterClient.Assign(ctx, req)
if grpcErr != nil {
return grpcErr
}