wire configured quota limits into routing

This commit is contained in:
kami
2026-07-26 20:34:38 +04:00
parent 6e4df6d2ff
commit 17e7aef871
3 changed files with 12 additions and 0 deletions
+9
View File
@@ -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() {
+1
View File
@@ -34,6 +34,7 @@ type Herdr struct {
Protocol string `json:"protocol,omitempty"`
Capabilities []string `json:"capabilities"`
Concurrency int `json:"concurrency"`
QuotaLimit float64 `json:"quota_limit,omitempty"`
}
type Config struct {
Projects []Project `json:"projects"`
+2
View File
@@ -71,6 +71,8 @@ Rotation now honors an optional herdr turn-boundary probe (`pane.status`) before
Federation control-plane foundations now include worker registration, heartbeat updates, TTL-based offline status, and `/v1/federation/workers` plus per-worker heartbeat endpoints. Remote event/lease transport and remote worktree ownership remain to be layered on this registry.
Configured herdr `quota_limit` values are now wired into router availability using the rolling-window 80% conservative filter; previously the quota implementation existed but was not active in server routing.
Recommended order:
1. Add the orchestration coordinator: lease → worktree → harness session → bootstrap → lifecycle events.