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

Commit

Permalink
runtime-api: do not cache None SessionInfo (#4706)
Browse files Browse the repository at this point in the history
* approval-voting: add more logs

* approval-voting: query finalized block on startup and increase look back

* runtime-api: do not cache None SessionInfo
  • Loading branch information
ordian authored Jan 13, 2022
1 parent 58a489d commit 2ba377f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion node/core/runtime-api/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ impl RequestResultCache {
}

pub(crate) fn cache_session_info(&mut self, key: SessionIndex, value: Option<SessionInfo>) {
self.session_info.insert(key, ResidentSizeOf(value));
// only cache Some(SessionInfo)
if value.is_some() {
self.session_info.insert(key, ResidentSizeOf(value));
}
}

pub(crate) fn dmq_contents(
Expand Down

0 comments on commit 2ba377f

Please sign in to comment.