WorkerCount returns the number of workers this CP currently has assigned to the org that count against MaxWorkers (hot-idle workers are excluded — they're parked for reclaim and don't consume the cap budget, same as atOrgWorkerCap). This is the per-CP local view; the admin layer sums it across repli
()
| 294 | // count budget), so a true result means every counted worker is actively |
| 295 | // assigned — a new worker cannot be added. |
| 296 | func (p *OrgReservedPool) atOrgWorkerCap() bool { |
| 297 | p.shared.mu.Lock() |
| 298 | defer p.shared.mu.Unlock() |
| 299 | return p.maxWorkers > 0 && p.assignedWorkerCountLocked() >= p.maxWorkers |
| 300 | } |
| 301 | |
| 302 | // WorkerCount returns the number of workers this CP currently has assigned to |
| 303 | // the org that count against MaxWorkers (hot-idle workers are excluded — they're |