Add diagnostics to tasks (#4752)

This commit is contained in:
Pierre Krieger
2020-01-29 11:46:39 +01:00
committed by GitHub
parent 34c1c4b954
commit b452867eb7
10 changed files with 117 additions and 52 deletions
+2 -2
View File
@@ -87,13 +87,13 @@ impl<Client, Block> sc_transaction_graph::ChainApi for FullChainApi<Client, Bloc
let client = self.client.clone();
let at = at.clone();
self.pool.spawn_ok(async move {
self.pool.spawn_ok(futures_diagnose::diagnose("validate-transaction", async move {
let res = client.runtime_api().validate_transaction(&at, uxt)
.map_err(|e| Error::RuntimeApi(format!("{:?}", e)));
if let Err(e) = tx.send(res) {
log::warn!("Unable to send a validate transaction result: {:?}", e);
}
});
}));
Box::pin(async move {
match rx.await {