From db62090f88b6af9d44c7a92f8ccb075e93b3d9a3 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 23 Dec 2020 12:14:51 -0800 Subject: s3: break loop if error fix https://github.com/chrislusf/seaweedfs/issues/1701 --- weed/s3api/s3api_objects_list_handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weed/s3api/s3api_objects_list_handlers.go') diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index dce2fd6b0..b674f87cd 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -315,7 +315,7 @@ func (s3a *S3ApiServer) isDirectoryAllEmpty(filerClient filer_pb.SeaweedFilerCli currentDir := parentDir + "/" + name var startFrom string var isExhausted bool - for fileCounter == 0 && !isExhausted { + for fileCounter == 0 && !isExhausted && err == nil { err = filer_pb.SeaweedList(filerClient, currentDir, "", func(entry *filer_pb.Entry, isLast bool) error { if entry.IsDirectory { subDirs = append(subDirs, entry.Name) -- cgit v1.2.3