runbot/runbot_builder/leader.py
Xavier-Do 0b30b9c104 [IMP] runbot: create a separate process for cron
As for the builder, this give the ability to run the discovery of new
commits and all related logic in a separate process.

This will mainly be usefull to restart frontend without waiting for cron
or restart "leader" without stoping the frontend. This will also be
usefull for optimisation purpose.
2021-12-08 15:06:49 +01:00

19 lines
467 B
Python
Executable File

#!/usr/bin/python3
from tools import RunbotClient, run
import logging
import time
_logger = logging.getLogger(__name__)
class LeaderClient(RunbotClient): # Conductor, Director, Main, Maestro, Lead
def __init__(self, env):
self.pull_info_failures = {}
super().__init__(env)
def loop_turn(self):
return self.env['runbot.runbot']._fetch_loop_turn(self.host, self.pull_info_failures)
if __name__ == '__main__':
run(LeaderClient)