From 67f6eb12c5a15ca120a83db0da5dd659ca5bb4a4 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Fri, 25 Sep 2020 15:01:42 +0200 Subject: [PATCH] [IMP] runbot: improve build order The old order based on status is not really needed anymore: - Scheduled builds have a special condition and already have a low priority. - Indirect builds don't exist anymore - It is actually questionnable to postpone rebuild. Sometimes they are needed but stuck. This new proposition will keep subbuild scheduling close to parent build. Some build may take 2 hours because they are parallelized and children are stuck. Priority should be defined by top parent. --- runbot/models/runbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/models/runbot.py b/runbot/models/runbot.py index 737d0572..5f5ef876 100644 --- a/runbot/models/runbot.py +++ b/runbot/models/runbot.py @@ -136,7 +136,7 @@ class Runbot(models.AbstractModel): WHERE %s ORDER BY - array_position(array['normal','rebuild','indirect','scheduled']::varchar[], runbot_build.build_type) ASC + parent_path FOR UPDATE OF runbot_build SKIP LOCKED LIMIT %%s )