[FIX] runbot: various FIX

This commit is contained in:
Xavier-Do 2022-06-17 13:52:37 +02:00
parent 26a3ad20f1
commit cbfc8401a8
3 changed files with 8 additions and 7 deletions

View File

@ -343,7 +343,7 @@ class Batch(models.Model):
if not bundle.sticky and self.category_id == default_category: if not bundle.sticky and self.category_id == default_category:
skippable = self.env['runbot.batch'].search([ skippable = self.env['runbot.batch'].search([
('bundle_id', '=', bundle.id), ('bundle_id', '=', bundle.id),
('state', '!=', 'done'), ('state', 'not in', ('done', 'skipped')),
('id', '<', self.id), ('id', '<', self.id),
('category_id', '=', default_category.id) ('category_id', '=', default_category.id)
]) ])

View File

@ -552,11 +552,11 @@ class Repo(models.Model):
def _update(self, force=False, poll_delay=5*60): def _update(self, force=False, poll_delay=5*60):
""" Update the physical git reposotories on FS""" """ Update the physical git reposotories on FS"""
for repo in self: self.ensure_one()
try: try:
return repo._update_git(force, poll_delay) return self._update_git(force, poll_delay)
except Exception: except Exception:
_logger.exception('Fail to update repo %s', repo.name) _logger.exception('Fail to update repo %s', self.name)
class RefTime(models.Model): class RefTime(models.Model):
_name = 'runbot.repo.reftime' _name = 'runbot.repo.reftime'

View File

@ -7,7 +7,8 @@ _logger = logging.getLogger(__name__)
class BuilderClient(RunbotClient): class BuilderClient(RunbotClient):
def on_start(self): 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): def loop_turn(self):
if self.count == 1: # cleanup at second iteration if self.count == 1: # cleanup at second iteration