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

Commit

Permalink
Renamed add_children to add_child since it adds only one child (#6838)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Aug 7, 2020
1 parent fba063c commit 0d24a21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 0d24a21

Please sign in to comment.