[FIX] runbot: apply small fixes

This commit is contained in:
Christophe Monniez 2022-06-20 11:21:14 +02:00 committed by xdo
parent d534f5a5e2
commit c006bf953d
2 changed files with 6 additions and 3 deletions

View File

@ -372,7 +372,7 @@ class Runbot(models.AbstractModel):
"""
cleanup and optimize git repositories on the host
"""
for repo in self.env['runbot.repo'].search():
for repo in self.env['runbot.repo'].search([]):
try:
repo._git(['gc', '--prune=all', '--quiet'])
except CalledProcessError as e:

View File

@ -11,12 +11,15 @@ class LeaderClient(RunbotClient): # Conductor, Director, Main, Maestro, Lead
super().__init__(env)
def on_start(self):
self.env['runbot.repo'].search([('mode', '!=', 'disabled')])._update(force=True)
_logger.info('Updating all repos')
for repo in self.env['runbot.repo'].search([('mode', '!=', 'disabled')]):
repo._update(force=True)
_logger.info('update finished')
def loop_turn(self):
if self.count == 0:
self.env['runbot.repo']._update_git_config()
self.git_gc()
self.git_gc()
return self.env['runbot.runbot']._fetch_loop_turn(self.host, self.pull_info_failures)