mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 10:57:08 +08:00
s3: skip hidden directories in /buckets folder
This commit is contained in:
parent
1c7e404abe
commit
89933c46d2
@ -3,6 +3,7 @@ package filer
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"math"
|
"math"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
@ -78,6 +79,9 @@ func (f *Filer) isBucket(entry *Entry) bool {
|
|||||||
if parent != f.DirBucketsPath {
|
if parent != f.DirBucketsPath {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(dirName, ".") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
f.buckets.RLock()
|
f.buckets.RLock()
|
||||||
defer f.buckets.RUnlock()
|
defer f.buckets.RUnlock()
|
||||||
|
@ -24,10 +24,14 @@ func (f *Filer) onBucketEvents(event *filer_pb.SubscribeMetadataResponse) {
|
|||||||
}
|
}
|
||||||
if f.DirBucketsPath == event.Directory {
|
if f.DirBucketsPath == event.Directory {
|
||||||
if message.OldEntry == nil && message.NewEntry != nil {
|
if message.OldEntry == nil && message.NewEntry != nil {
|
||||||
f.Store.OnBucketCreation(message.NewEntry.Name)
|
if message.NewEntry.IsDirectory {
|
||||||
|
f.Store.OnBucketCreation(message.NewEntry.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if message.OldEntry != nil && message.NewEntry == nil {
|
if message.OldEntry != nil && message.NewEntry == nil {
|
||||||
f.Store.OnBucketDeletion(message.OldEntry.Name)
|
if message.OldEntry.IsDirectory {
|
||||||
|
f.Store.OnBucketDeletion(message.OldEntry.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user