mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: avoid ask kill on already dying builds
This commit is contained in:
parent
3d428428eb
commit
26dce90dd8
@ -545,14 +545,12 @@ class runbot_repo(models.Model):
|
|||||||
# decide if we need room
|
# decide if we need room
|
||||||
Build = self.env['runbot.build']
|
Build = self.env['runbot.build']
|
||||||
domain_host = self.build_domain_host(host)
|
domain_host = self.build_domain_host(host)
|
||||||
testing_builds = Build.search(domain_host + [('local_state', 'in', ['testing', 'pending'])])
|
testing_builds = Build.search(domain_host + [('local_state', 'in', ['testing', 'pending']), ('requested_action', '!=', 'deathrow')])
|
||||||
used_slots = len(testing_builds)
|
used_slots = len(testing_builds)
|
||||||
available_slots = host.get_nb_worker() - used_slots
|
available_slots = host.get_nb_worker() - used_slots
|
||||||
nb_pending = Build.search_count([('local_state', '=', 'pending'), ('host', '=', False)])
|
nb_pending = Build.search_count([('local_state', '=', 'pending'), ('host', '=', False)])
|
||||||
if available_slots > 0 or nb_pending == 0:
|
if available_slots > 0 or nb_pending == 0:
|
||||||
return
|
return
|
||||||
builds_to_kill = self.env['runbot.build']
|
|
||||||
builds_to_skip = self.env['runbot.build']
|
|
||||||
for build in testing_builds:
|
for build in testing_builds:
|
||||||
top_parent = build._get_top_parent()
|
top_parent = build._get_top_parent()
|
||||||
if not build.branch_id.sticky:
|
if not build.branch_id.sticky:
|
||||||
|
Loading…
Reference in New Issue
Block a user