mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 03:21:06 +00:00
avoid timer in light client (#4602)
This commit is contained in:
committed by
Bastian Köcher
parent
08e6df0faf
commit
e00ddc5614
@@ -63,6 +63,8 @@ pub struct LightStorage<Block: BlockT> {
|
|||||||
meta: RwLock<Meta<NumberFor<Block>, Block::Hash>>,
|
meta: RwLock<Meta<NumberFor<Block>, Block::Hash>>,
|
||||||
cache: Arc<DbCacheSync<Block>>,
|
cache: Arc<DbCacheSync<Block>>,
|
||||||
header_metadata_cache: HeaderMetadataCache<Block>,
|
header_metadata_cache: HeaderMetadataCache<Block>,
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "unknown"))]
|
||||||
io_stats: FrozenForDuration<kvdb::IoStats>,
|
io_stats: FrozenForDuration<kvdb::IoStats>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +104,7 @@ impl<Block> LightStorage<Block>
|
|||||||
meta: RwLock::new(meta),
|
meta: RwLock::new(meta),
|
||||||
cache: Arc::new(DbCacheSync(RwLock::new(cache))),
|
cache: Arc::new(DbCacheSync(RwLock::new(cache))),
|
||||||
header_metadata_cache: HeaderMetadataCache::default(),
|
header_metadata_cache: HeaderMetadataCache::default(),
|
||||||
|
#[cfg(not(target_os = "unknown"))]
|
||||||
io_stats: FrozenForDuration::new(std::time::Duration::from_secs(1), kvdb::IoStats::empty()),
|
io_stats: FrozenForDuration::new(std::time::Duration::from_secs(1), kvdb::IoStats::empty()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -558,6 +561,7 @@ impl<Block> LightBlockchainStorage<Block> for LightStorage<Block>
|
|||||||
Some(self.cache.clone())
|
Some(self.cache.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "unknown"))]
|
||||||
fn usage_info(&self) -> Option<UsageInfo> {
|
fn usage_info(&self) -> Option<UsageInfo> {
|
||||||
use sc_client_api::{MemoryInfo, IoInfo};
|
use sc_client_api::{MemoryInfo, IoInfo};
|
||||||
|
|
||||||
@@ -579,6 +583,11 @@ impl<Block> LightBlockchainStorage<Block> for LightStorage<Block>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "unknown")]
|
||||||
|
fn usage_info(&self) -> Option<UsageInfo> {
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build the key for inserting header-CHT at given block.
|
/// Build the key for inserting header-CHT at given block.
|
||||||
|
|||||||
Reference in New Issue
Block a user