1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-05 16:47:04 +02:00

add self filer

This commit is contained in:
Chris Lu 2020-09-06 00:11:46 -07:00
parent 8acd714600
commit 30dc365cbd

View file

@ -62,9 +62,16 @@ func NewFiler(masters []string, grpcDialOption grpc.DialOption,
func (f *Filer) AggregateFromPeers(self string, filers []string) {
// set peers
if len(filers) == 0 {
found := false
for _, peer := range filers {
if peer == self {
found = true
}
}
if !found {
filers = append(filers, self)
}
f.MetaAggregator = NewMetaAggregator(filers, f.GrpcDialOption)
f.MetaAggregator.StartLoopSubscribe(f, self)