network: guard validation network future under exit signal (#167)

This commit is contained in:
André Silva
2019-03-04 15:19:45 +00:00
committed by GitHub
parent 30472a18ab
commit 23d7f459a2
+2 -1
View File
@@ -232,6 +232,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
let table_router_clone = table_router.clone();
let executor = self.executor.clone();
let exit = self.exit.clone();
// spin up a task in the background that processes all incoming statements
// TODO: propagate statements on a timer?
@@ -248,7 +249,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
table_router: table_router_clone,
};
executor.spawn(process_task);
executor.spawn(process_task.select(exit).then(|_| Ok(())));
});
table_router