From a9cd5d7a60fdb3bd65002dd408eb595347ba4b1f Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Sat, 15 Jun 2019 07:45:20 +0200 Subject: [PATCH] [IMP] runbot: allow to configure workers per host When a runbot instance is scheduling builds, the numbers of builds depends of a global ir.config_parameter. Even if one of the runbot instance is running on a more powerful systsem, its number of workers is limited by this global parameter. With this commit, this parameter still exists but can be overriden by specific ir.config_parameter. For example, if the host 'runbot24.odoo.com' has more cpu power, the number of workers for this host can be specified in the ir.config_parameter named 'runbot24.odoo.com.workers'. --- runbot/models/repo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index 02dab328..7a04e7dd 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -347,9 +347,10 @@ class runbot_repo(models.Model): if not ids: return icp = self.env['ir.config_parameter'] - workers = int(icp.get_param('runbot.runbot_workers', default=6)) - running_max = int(icp.get_param('runbot.runbot_running_max', default=75)) host = fqdn() + settings_workers = int(icp.get_param('runbot.runbot_workers', default=6)) + workers = int(icp.get_param('%s.workers' % host, default=settings_workers)) + running_max = int(icp.get_param('runbot.runbot_running_max', default=75)) Build = self.env['runbot.build'] domain = [('repo_id', 'in', ids)]