Browse Source

s3: skip hidden directories in /buckets folder

pull/2228/head
Chris Lu 3 years ago
parent
commit
89933c46d2
  1. 4
      weed/filer/filer_buckets.go
  2. 4
      weed/filer/filer_on_meta_event.go

4
weed/filer/filer_buckets.go

@ -3,6 +3,7 @@ package filer
import (
"context"
"math"
"strings"
"sync"
"github.com/chrislusf/seaweedfs/weed/glog"
@ -78,6 +79,9 @@ func (f *Filer) isBucket(entry *Entry) bool {
if parent != f.DirBucketsPath {
return false
}
if strings.HasPrefix(dirName, ".") {
return false
}
f.buckets.RLock()
defer f.buckets.RUnlock()

4
weed/filer/filer_on_meta_event.go

@ -24,13 +24,17 @@ func (f *Filer) onBucketEvents(event *filer_pb.SubscribeMetadataResponse) {
}
if f.DirBucketsPath == event.Directory {
if message.OldEntry == nil && message.NewEntry != nil {
if message.NewEntry.IsDirectory {
f.Store.OnBucketCreation(message.NewEntry.Name)
}
}
if message.OldEntry != nil && message.NewEntry == nil {
if message.OldEntry.IsDirectory {
f.Store.OnBucketDeletion(message.OldEntry.Name)
}
}
}
}
func (f *Filer) maybeReloadFilerConfiguration(event *filer_pb.SubscribeMetadataResponse) {
if DirectoryEtcSeaweedFS != event.Directory {

Loading…
Cancel
Save