[IMP] runbot: allow to disable fetch on start

This commit is contained in:
Xavier-Do 2024-02-05 12:00:28 +01:00
parent 7bbd1271c6
commit b6bc0e3911
2 changed files with 8 additions and 6 deletions

View File

@ -16,8 +16,9 @@ class BuilderClient(RunbotClient):
monitoring_thread = threading.Thread(target=docker_monitoring_loop, args=(builds_path,), daemon=True)
monitoring_thread.start()
for repo in self.env['runbot.repo'].search([('mode', '!=', 'disabled')]):
repo._update(force=True)
if self.env['ir.config_parameter'].sudo().get_param('runbot.runbot_do_fetch'):
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

View File

@ -11,10 +11,11 @@ class LeaderClient(RunbotClient): # Conductor, Director, Main, Maestro, Lead
super().__init__(env)
def on_start(self):
_logger.info('Updating all repos')
for repo in self.env['runbot.repo'].search([('mode', '!=', 'disabled')]):
repo._update(force=True)
_logger.info('update finished')
if self.env['ir.config_parameter'].sudo().get_param('runbot.runbot_do_fetch'):
_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: