Skip to content

Commit

Permalink
performance improvements for passive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Mar 21, 2023
1 parent b8f8520 commit b43efec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion systems/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ func NewLocalSystem(cfg *config.Config) (*LocalSystem, error) {
return nil, errors.New("the system was unable to build the pool of trusted resolvers")
}

pool, num := untrustedResolvers(cfg)
pool, num := trusted, num
if !cfg.Passive {
pool, num = untrustedResolvers(cfg)
}

if pool == nil || num == 0 {
return nil, errors.New("the system was unable to build the pool of untrusted resolvers")
}
Expand Down Expand Up @@ -220,6 +224,9 @@ func (l *LocalSystem) setupGraphDBs() error {
}
dbs = append(dbs, cfg.GraphDBs...)

if cfg.Passive {
l.graphs = append(l.graphs, netmap.NewGraph(netmap.NewCayleyGraphMemory()))
}
for _, db := range dbs {
cayley := netmap.NewCayleyGraph(db.System, db.URL, db.Options)
if cayley == nil {
Expand Down

0 comments on commit b43efec

Please sign in to comment.