countEligible returns the number of prebuilds that are ready to be claimed. A prebuild is eligible if it's running and its agents are in ready state.
()
| 440 | // countEligible returns the number of prebuilds that are ready to be claimed. |
| 441 | // A prebuild is eligible if it's running and its agents are in ready state. |
| 442 | func (p PresetSnapshot) countEligible() int32 { |
| 443 | var count int32 |
| 444 | for _, prebuild := range p.Running { |
| 445 | if prebuild.Ready { |
| 446 | count++ |
| 447 | } |
| 448 | } |
| 449 | return count |
| 450 | } |
| 451 | |
| 452 | // countInProgress returns counts of prebuilds in transition states (starting, stopping, deleting). |
| 453 | // These counts are tracked at the template level, so all presets sharing the same template see the same values. |