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 (#4726)
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Jan 15, 2022
1 parent 5035047 commit 4f5373a
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 @@ -305,7 +305,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 4f5373a

Please sign in to comment.