mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add self filer
This commit is contained in:
parent
8acd714600
commit
30dc365cbd
|
@ -62,9 +62,16 @@ func NewFiler(masters []string, grpcDialOption grpc.DialOption,
|
||||||
func (f *Filer) AggregateFromPeers(self string, filers []string) {
|
func (f *Filer) AggregateFromPeers(self string, filers []string) {
|
||||||
|
|
||||||
// set peers
|
// set peers
|
||||||
if len(filers) == 0 {
|
found := false
|
||||||
|
for _, peer := range filers {
|
||||||
|
if peer == self {
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
filers = append(filers, self)
|
filers = append(filers, self)
|
||||||
}
|
}
|
||||||
|
|
||||||
f.MetaAggregator = NewMetaAggregator(filers, f.GrpcDialOption)
|
f.MetaAggregator = NewMetaAggregator(filers, f.GrpcDialOption)
|
||||||
f.MetaAggregator.StartLoopSubscribe(f, self)
|
f.MetaAggregator.StartLoopSubscribe(f, self)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue