diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-09-09 12:07:15 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-09-09 12:07:15 -0700 |
| commit | daf0a449f7424d4a8252673509af5afd0b9bd8ec (patch) | |
| tree | e9b9ba152b2fade26b71e7710ae6730dafe9d39e /weed/s3api | |
| parent | 7f69acd1f21b4e42afff155b633419eda17af331 (diff) | |
| download | seaweedfs-daf0a449f7424d4a8252673509af5afd0b9bd8ec.tar.xz seaweedfs-daf0a449f7424d4a8252673509af5afd0b9bd8ec.zip | |
properly cancel context for streaming grpc
Diffstat (limited to 'weed/s3api')
| -rw-r--r-- | weed/s3api/s3api_objects_list_handlers.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index b6779dfb7..30d566f94 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -212,7 +212,9 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d InclusiveStartFrom: false, } - stream, listErr := client.ListEntries(context.Background(), request) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + stream, listErr := client.ListEntries(ctx, request) if listErr != nil { err = fmt.Errorf("list entires %+v: %v", request, listErr) return |
