diff --git a/runbot/models/batch.py b/runbot/models/batch.py index 04fc2b0a..a0920485 100644 --- a/runbot/models/batch.py +++ b/runbot/models/batch.py @@ -343,7 +343,7 @@ class Batch(models.Model): if not bundle.sticky and self.category_id == default_category: skippable = self.env['runbot.batch'].search([ ('bundle_id', '=', bundle.id), - ('state', '!=', 'done'), + ('state', 'not in', ('done', 'skipped')), ('id', '<', self.id), ('category_id', '=', default_category.id) ]) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index aff40c24..65beee3f 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -552,11 +552,11 @@ class Repo(models.Model): def _update(self, force=False, poll_delay=5*60): """ Update the physical git reposotories on FS""" - for repo in self: - try: - return repo._update_git(force, poll_delay) - except Exception: - _logger.exception('Fail to update repo %s', repo.name) + self.ensure_one() + try: + return self._update_git(force, poll_delay) + except Exception: + _logger.exception('Fail to update repo %s', self.name) class RefTime(models.Model): _name = 'runbot.repo.reftime' diff --git a/runbot_builder/builder.py b/runbot_builder/builder.py index e8d8bedd..430df060 100755 --- a/runbot_builder/builder.py +++ b/runbot_builder/builder.py @@ -7,7 +7,8 @@ _logger = logging.getLogger(__name__) class BuilderClient(RunbotClient): def on_start(self): - self.env['runbot.repo'].search([('mode', '!=', 'disabled')])._update(force=True) + for repo in self.env['runbot.repo'].search([('mode', '!=', 'disabled')]): + repo._update(force=True) def loop_turn(self): if self.count == 1: # cleanup at second iteration