mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-21 13:34:26 +02:00
s3: add option for "alllowEmptyFolder"
This commit is contained in:
1 parent
aa020ee7e7
commit
561a2ff0bc
3 files changed
+15
-9
No files matched your search
@@ -264,8 +264,10 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||
}
|
||||
} else {
|
||||
var isEmpty bool
|
||||
if isEmpty, err = s3a.isDirectoryAllEmpty(client, dir, entry.Name); err != nil {
|
||||
glog.Errorf("check empty folder %s: %v", dir, err)
|
||||
if !s3a.option.AllowEmptyFolder {
|
||||
if isEmpty, err = s3a.isDirectoryAllEmpty(client, dir, entry.Name); err != nil {
|
||||
glog.Errorf("check empty folder %s: %v", dir, err)
|
||||
}
|
||||
}
|
||||
if !isEmpty {
|
||||
eachEntryFn(dir, entry)
|
||||
|
||||
@@ -20,6 +20,7 @@ type S3ApiServerOption struct {
|
||||
DomainName string
|
||||
BucketsPath string
|
||||
GrpcDialOption grpc.DialOption
|
||||
AllowEmptyFolder bool
|
||||
}
|
||||
|
||||
type S3ApiServer struct {
|
||||
|
||||
Reference in new issue
Block a user