diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs index 80384ea8..1440859b 100644 --- a/src/api2/node/tasks.rs +++ b/src/api2/node/tasks.rs @@ -352,6 +352,7 @@ pub fn list_tasks( } match info.state { + Some(_) if running => return None, Some(crate::server::TaskState::OK { .. }) if errors => return None, _ => {}, } diff --git a/src/server/worker_task.rs b/src/server/worker_task.rs index be689c7f..b2e2abd5 100644 --- a/src/server/worker_task.rs +++ b/src/server/worker_task.rs @@ -539,7 +539,7 @@ impl TaskListInfoIterator { let needs_update = active_list .iter() - .any(|info| info.state.is_none() && !worker_is_active_local(&info.upid)); + .any(|info| info.state.is_some() || !worker_is_active_local(&info.upid)); if needs_update { drop(lock);