backend: always prioritize flow steps (#5108)
When a flow start, his flow steps have lower priority than already scheduled jobs, hence steps are only executed when the queue is drained which considerably increase flow execution time when queue size is significant. This add a very low priority to flow steps in order to prioritize finishing a started flow over new jobs.
This commit is contained in:
@@ -3550,6 +3550,12 @@ pub async fn push<'c, 'd>(
|
||||
_low_level_priority
|
||||
}; // else it remains empty, i.e. no priority
|
||||
}
|
||||
// prioritize flow steps to drain the queue faster
|
||||
let final_priority = if flow_step_id.is_some() && final_priority.is_none() {
|
||||
Some(0)
|
||||
} else {
|
||||
final_priority
|
||||
};
|
||||
|
||||
let is_running = same_worker;
|
||||
if let Some(flow) = raw_flow.as_ref() {
|
||||
|
||||
Reference in New Issue
Block a user