check idle circuits against path

This commit is contained in:
Paul Lorenz
2022-01-24 13:07:14 -05:00
parent d46e7be680
commit 4f5e7b3591
2 changed files with 18 additions and 5 deletions
+12
View File
@@ -42,6 +42,18 @@ func (self *Circuit) latency() int64 {
return latency
}
func (self *Circuit) HasRouter(r *Router) bool {
if self == nil || self.Path == nil {
return false
}
for _, node := range self.Path.Nodes {
if node.Id == r.Id {
return true
}
}
return false
}
type circuitController struct {
circuits cmap.ConcurrentMap // map[string]*Circuit
idGenerator idgen.Generator