mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] runbot: timeout per repo
This commit is contained in:
parent
231e456e3b
commit
9ebc8d6447
@ -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')
|
||||
|
@ -24,6 +24,7 @@
|
||||
<field name="dependency_ids" widget="many2many_tags"/>
|
||||
<field name="modules"/>
|
||||
<field name="modules_auto"/>
|
||||
<field name="job_timeout"/>
|
||||
<field name="token"/>
|
||||
<field name="group_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
|
Loading…
Reference in New Issue
Block a user