diff --git a/runbot/models/build.py b/runbot/models/build.py index 9b8a4ca1..e84326b0 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -595,7 +595,7 @@ class runbot_build(models.Model): build._log('_schedule', '%s time exceeded (%ss)' % (build.active_step.name if build.active_step else "?", build.job_time)) build._kill(result='killed') continue - elif build.job_time < 15: + elif build.active_step._is_docker_step() and build.job_time < 15: _logger.debug('container "%s" seems too take a while to start', build._get_docker_name()) continue # No job running, make result and select nex job diff --git a/runbot/models/build_config.py b/runbot/models/build_config.py index 6f84df8e..6e00e000 100644 --- a/runbot/models/build_config.py +++ b/runbot/models/build_config.py @@ -237,8 +237,17 @@ class ConfigStep(models.Model): } return safe_eval(self.sudo().python_code.strip(), eval_ctx, mode="exec", nocopy=True) + def _is_docker_step(self): + if not self: + return False + self.ensure_one() + return self.job_type in ('install_odoo', 'run_odoo') or (self.job_type == 'python' and 'docker_run(' in self.python_code) + def _run_odoo_run(self, build, log_path): exports = build._checkout() + # update job_start AFTER checkout to avoid build being killed too soon if checkout took some time and docker take some time to start + build.job_start = now() + # adjust job_end to record an accurate job_20 job_time build._log('run', 'Start running build %s' % build.dest) # run server @@ -273,6 +282,8 @@ class ConfigStep(models.Model): def _run_odoo_install(self, build, log_path): exports = build._checkout() + # update job_start AFTER checkout to avoid build being killed too soon if checkout took some time and docker take some time to start + build.job_start = now() modules_to_install = self._modules_to_install(build) mods = ",".join(modules_to_install) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index a58c9ba7..5142296b 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -115,7 +115,7 @@ class runbot_repo(models.Model): repo.short_name = '/'.join(repo.base.split('/')[-2:]) def _get_repo_name_part(self): - self.ensure_one + self.ensure_one() return self._sanitized_name(self.name.split('/')[-1]) def _git(self, cmd):