Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Renamed add_children to add_child since it adds only one child #6838

Merged
merged 3 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/service/src/task_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
12 changes: 6 additions & 6 deletions client/service/src/task_manager/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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()));
Expand Down Expand Up @@ -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()));
Expand Down