From 9ebc8d644711a45599f9ab6fd257599306990ecf Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 3 Aug 2015 18:07:19 +0200 Subject: [PATCH] [IMP] runbot: timeout per repo --- runbot/runbot.py | 5 +++-- runbot/runbot.xml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index caa08fd8..e79161a3 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -196,10 +196,12 @@ class runbot_repo(osv.osv): help="Community addon repos which need to be present to run tests."), 'token': fields.char("Github token"), 'group_ids': fields.many2many('res.groups', string='Limited to groups'), + 'job_timeout': fields.integer('Job Timeout (minutes)', required=True), } _defaults = { 'auto': True, 'modules_auto': 'repo', + 'job_timeout': 30, } def domain(self, cr, uid, context=None): @@ -950,8 +952,6 @@ class runbot_build(osv.osv): def schedule(self, cr, uid, ids, context=None): jobs = self.list_jobs() - icp = self.pool['ir.config_parameter'] - timeout = int(icp.get_param(cr, uid, 'runbot.timeout', default=1800)) for build in self.browse(cr, uid, ids, context=context): if build.state == 'pending': @@ -972,6 +972,7 @@ class runbot_build(osv.osv): lock_path = build.path('logs', '%s.lock' % build.job) if locked(lock_path): # kill if overpassed + timeout = build.repo_id.job_timeout * 60 if build.job != jobs[-1] and build.job_time > timeout: build.logger('%s time exceded (%ss)', build.job, build.job_time) build.kill(result='killed') diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 1e73977f..cb4de123 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -24,6 +24,7 @@ +