wire configured quota limits into routing
This commit is contained in:
@@ -42,6 +42,15 @@ func main() {
|
||||
log.Fatalf("load orchestra config: %v", err)
|
||||
}
|
||||
rt = &router.Router{Store: s, Registry: rr, Reachability: registry.TCPReachability{}, Timeout: time.Second, Retry: router.RetryPolicy{MaxAttempts: 3, Backoff: time.Minute}}
|
||||
limits := map[string]float64{}
|
||||
for _, h := range rr.Herdrs() {
|
||||
if h.QuotaLimit > 0 {
|
||||
limits[h.ID] = h.QuotaLimit
|
||||
}
|
||||
}
|
||||
if len(limits) > 0 {
|
||||
rt.Availability = router.QuotaAvailability{Store: s, Limits: limits, Window: 7 * 24 * time.Hour}
|
||||
}
|
||||
if repo, root := os.Getenv("ORCHESTRA_REPO"), os.Getenv("ORCHESTRA_WORKTREE_ROOT"); repo != "" && root != "" {
|
||||
adapters := map[string]herdr.Adapter{}
|
||||
for _, h := range rr.Herdrs() {
|
||||
|
||||
Reference in New Issue
Block a user