diff --git a/client/service/src/task_manager/mod.rs b/client/service/src/task_manager/mod.rs index 729b43bce94c1..6925d27f4e5ca 100644 --- a/client/service/src/task_manager/mod.rs +++ b/client/service/src/task_manager/mod.rs @@ -344,7 +344,7 @@ impl TaskManager { /// Register another TaskManager to terminate and gracefully shutdown when the parent /// terminates and gracefully shutdown. Also ends the parent `future()` if a child's essential /// task fails. (But don't end the parent if a child's normal task fails.) - pub fn add_children(&mut self, child: TaskManager) { + pub fn add_child(&mut self, child: TaskManager) { self.children.push(child); } } diff --git a/client/service/src/task_manager/tests.rs b/client/service/src/task_manager/tests.rs index a2bd84802aa17..27d9b0b9e9ad9 100644 --- a/client/service/src/task_manager/tests.rs +++ b/client/service/src/task_manager/tests.rs @@ -220,8 +220,8 @@ fn ensure_children_tasks_ends_when_task_manager_terminated() { let spawn_handle_child_1 = child_1.spawn_handle(); let child_2 = TaskManager::new(task_executor.clone(), None).unwrap(); let spawn_handle_child_2 = child_2.spawn_handle(); - task_manager.add_children(child_1); - task_manager.add_children(child_2); + task_manager.add_child(child_1); + task_manager.add_child(child_2); let spawn_handle = task_manager.spawn_handle(); let drop_tester = DropTester::new(); spawn_handle.spawn("task1", run_background_task(drop_tester.new_ref())); @@ -250,8 +250,8 @@ fn ensure_task_manager_future_ends_with_error_when_childs_essential_task_fails() let spawn_essential_handle_child_1 = child_1.spawn_essential_handle(); let child_2 = TaskManager::new(task_executor.clone(), None).unwrap(); let spawn_handle_child_2 = child_2.spawn_handle(); - task_manager.add_children(child_1); - task_manager.add_children(child_2); + task_manager.add_child(child_1); + task_manager.add_child(child_2); let spawn_handle = task_manager.spawn_handle(); let drop_tester = DropTester::new(); spawn_handle.spawn("task1", run_background_task(drop_tester.new_ref())); @@ -280,8 +280,8 @@ fn ensure_task_manager_future_continues_when_childs_not_essential_task_fails() { let spawn_handle_child_1 = child_1.spawn_handle(); let child_2 = TaskManager::new(task_executor.clone(), None).unwrap(); let spawn_handle_child_2 = child_2.spawn_handle(); - task_manager.add_children(child_1); - task_manager.add_children(child_2); + task_manager.add_child(child_1); + task_manager.add_child(child_2); let spawn_handle = task_manager.spawn_handle(); let drop_tester = DropTester::new(); spawn_handle.spawn("task1", run_background_task(drop_tester.new_ref()));