Skip to content

Commit b43efec

Browse files
committed
performance improvements for passive mode
1 parent b8f8520 commit b43efec

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

systems/local.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ func NewLocalSystem(cfg *config.Config) (*LocalSystem, error) {
4747
return nil, errors.New("the system was unable to build the pool of trusted resolvers")
4848
}
4949

50-
pool, num := untrustedResolvers(cfg)
50+
pool, num := trusted, num
51+
if !cfg.Passive {
52+
pool, num = untrustedResolvers(cfg)
53+
}
54+
5155
if pool == nil || num == 0 {
5256
return nil, errors.New("the system was unable to build the pool of untrusted resolvers")
5357
}
@@ -220,6 +224,9 @@ func (l *LocalSystem) setupGraphDBs() error {
220224
}
221225
dbs = append(dbs, cfg.GraphDBs...)
222226

227+
if cfg.Passive {
228+
l.graphs = append(l.graphs, netmap.NewGraph(netmap.NewCayleyGraphMemory()))
229+
}
223230
for _, db := range dbs {
224231
cayley := netmap.NewCayleyGraph(db.System, db.URL, db.Options)
225232
if cayley == nil {

0 commit comments

Comments
 (0)