Browse Source

stop a gRPC stream from the client-side callback is to return a specific error, e.g., io.EOF

pull/7426/head
chrislu 4 weeks ago
parent
commit
92525d78ce
  1. 4
      weed/s3api/s3api_object_handlers_delete.go

4
weed/s3api/s3api_object_handlers_delete.go

@ -417,10 +417,10 @@ func deleteEmptyParentDirectories(client filer_pb.SeaweedFilerClient, dirPath ut
isEmpty := true
err := filer_pb.SeaweedList(ctx, client, string(dirPath), "", func(entry *filer_pb.Entry, isLast bool) error {
isEmpty = false
return nil
return io.EOF // Use sentinel error to explicitly stop iteration
}, "", false, 1)
if err != nil {
if err != nil && err != io.EOF {
glog.V(3).Infof("deleteEmptyParentDirectories: error checking %s: %v", dirPath, err)
return
}

Loading…
Cancel
Save