Merge pull request #2707 from ryanpetrello/min-max-workers

prevent the dispatcher from using a nonsensical max_workers value

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2018-11-16 15:41:42 +00:00 committed by GitHub
commit 2f669685d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,6 +296,10 @@ class AutoscalePool(WorkerPool):
# 5 workers per GB of total memory
self.max_workers = (total_memory_gb * 5)
# max workers can't be less than min_workers
self.max_workers = max(self.min_workers, self.max_workers)
logger.warning(self.debug_meta)
@property
def should_grow(self):
if len(self.workers) < self.min_workers: