src/server/worker_task.rs: change task list sort order - latest on top

This commit is contained in:
Dietmar Maurer 2019-04-11 09:43:33 +02:00
parent f3832b6355
commit ba70040dbf
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ fn update_active_workers(new_upid: Option<&UPID>) -> Result<Vec<TaskListInfo>, E
let mut task_list: Vec<TaskListInfo> = vec![]; let mut task_list: Vec<TaskListInfo> = vec![];
for (_, info) in task_hash { task_list.push(info); } for (_, info) in task_hash { task_list.push(info); }
task_list.sort_unstable_by(|a, b| { task_list.sort_unstable_by(|b, a| { // lastest on top
match (&a.state, &b.state) { match (&a.state, &b.state) {
(Some(s1), Some(s2)) => s1.0.cmp(&s2.0), (Some(s1), Some(s2)) => s1.0.cmp(&s2.0),
(Some(_), None) => std::cmp::Ordering::Less, (Some(_), None) => std::cmp::Ordering::Less,