mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: correct build killing
This commit is contained in:
parent
275f55d227
commit
c5486cb430
@ -713,10 +713,7 @@ class runbot_build(osv.osv):
|
|||||||
# kill if overpassed
|
# kill if overpassed
|
||||||
if build.job != jobs[-1] and build.job_time > 1800:
|
if build.job != jobs[-1] and build.job_time > 1800:
|
||||||
build.logger('%s time exceded (%ss)', build.job, build.job_time)
|
build.logger('%s time exceded (%ss)', build.job, build.job_time)
|
||||||
try:
|
build.kill()
|
||||||
os.killpg(build.pid, signal.SIGKILL)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
continue
|
continue
|
||||||
build.logger('%s finished', build.job)
|
build.logger('%s finished', build.job)
|
||||||
# schedule
|
# schedule
|
||||||
@ -750,11 +747,12 @@ class runbot_build(osv.osv):
|
|||||||
def kill(self, cr, uid, ids, context=None):
|
def kill(self, cr, uid, ids, context=None):
|
||||||
for build in self.browse(cr, uid, ids, context=context):
|
for build in self.browse(cr, uid, ids, context=context):
|
||||||
build.logger('killing %s', build.pid)
|
build.logger('killing %s', build.pid)
|
||||||
|
build._log('kill', 'Kill build %s' % build.dest)
|
||||||
try:
|
try:
|
||||||
os.killpg(build.pid, signal.SIGKILL)
|
os.killpg(build.pid, signal.SIGKILL)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
build.write({'state':'done', 'result': 'killed'})
|
build.write({'state':'done', 'result': 'killed', 'job': False})
|
||||||
cr.commit()
|
cr.commit()
|
||||||
self.pg_dropdb(cr, uid, "%s-base" % build.dest)
|
self.pg_dropdb(cr, uid, "%s-base" % build.dest)
|
||||||
self.pg_dropdb(cr, uid, "%s-all" % build.dest)
|
self.pg_dropdb(cr, uid, "%s-all" % build.dest)
|
||||||
|
Loading…
Reference in New Issue
Block a user