mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
Add diagnostics to tasks (#4752)
This commit is contained in:
@@ -8,6 +8,7 @@ edition = "2018"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
derive_more = "0.99.2"
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures-diagnose = "1.0"
|
||||
log = "0.4.8"
|
||||
parking_lot = "0.9.0"
|
||||
sp-core = { path = "../../primitives/core" }
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user