[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.
This commit is contained in:
Xavier-Do 2020-09-25 15:01:42 +02:00 committed by Christophe Monniez
parent 6c3f14ed61
commit 67f6eb12c5

View File

@ -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
)