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

This commit is contained in:
chrislu
2025-11-05 13:38:40 -08:00
parent 629b520edf
commit 92525d78ce
+2 -2
View File
@@ -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
}