mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: avoid concurrent write and useless still in use messages
This commit is contained in:
parent
0b30b9c104
commit
e22c403102
@ -83,12 +83,15 @@ class Batch(models.Model):
|
|||||||
for slot in batch.slot_ids:
|
for slot in batch.slot_ids:
|
||||||
slot.skipped = True
|
slot.skipped = True
|
||||||
build = slot.build_id
|
build = slot.build_id
|
||||||
|
if build.global_state in ('running', 'done'):
|
||||||
|
continue
|
||||||
testing_slots = build.slot_ids.filtered(lambda s: not s.skipped)
|
testing_slots = build.slot_ids.filtered(lambda s: not s.skipped)
|
||||||
if not testing_slots:
|
if not testing_slots:
|
||||||
if build.global_state == 'pending':
|
if build.global_state == 'pending':
|
||||||
build._skip('Newer build found')
|
build._skip('Newer build found')
|
||||||
elif build.global_state in ('waiting', 'testing'):
|
elif build.global_state in ('waiting', 'testing'):
|
||||||
build.killable = True
|
if not build.killable:
|
||||||
|
build.killable = True
|
||||||
elif slot.link_type == 'created':
|
elif slot.link_type == 'created':
|
||||||
batches = testing_slots.mapped('batch_id')
|
batches = testing_slots.mapped('batch_id')
|
||||||
_logger.info('Cannot skip build %s build is still in use in batches %s', build.id, batches.ids)
|
_logger.info('Cannot skip build %s build is still in use in batches %s', build.id, batches.ids)
|
||||||
@ -117,7 +120,8 @@ class Batch(models.Model):
|
|||||||
build = self.env['runbot.build'].search([('params_id', '=', params.id), ('parent_id', '=', False)], limit=1, order='id desc')
|
build = self.env['runbot.build'].search([('params_id', '=', params.id), ('parent_id', '=', False)], limit=1, order='id desc')
|
||||||
link_type = 'matched'
|
link_type = 'matched'
|
||||||
if build:
|
if build:
|
||||||
build.killable = False
|
if build.killable:
|
||||||
|
build.killable = False
|
||||||
else:
|
else:
|
||||||
description = params.trigger_id.description if params.trigger_id.description else False
|
description = params.trigger_id.description if params.trigger_id.description else False
|
||||||
link_type = 'created'
|
link_type = 'created'
|
||||||
|
Loading…
Reference in New Issue
Block a user