Fix starter limits

This commit is contained in:
Stéphane Bidoul 2021-10-29 00:27:17 +02:00
parent d1e23fe551
commit c2b2d88f4c
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92

View file

@ -83,8 +83,8 @@ class Controller:
while True: while True:
await self._wakeup_event.wait() await self._wakeup_event.wait()
while True: while True:
can_start = max( can_start = min(
self.max_running - self.running, self.max_running - self.running + 1,
self.max_starting - self.starting, self.max_starting - self.starting,
) )
if can_start <= 0: if can_start <= 0: