Fix session index lookup for activated leaf (#4850)

This commit is contained in:
Chris Sosnin
2022-03-11 14:14:48 +03:00
committed by GitHub
parent 6fc2da146f
commit 681f3f4ed9
3 changed files with 21 additions and 19 deletions
@@ -99,14 +99,13 @@ impl SessionCache {
ctx: &mut Context,
runtime: &mut RuntimeInfo,
parent: Hash,
session_index: SessionIndex,
with_info: F,
) -> Result<Option<R>>
where
Context: SubsystemContext,
F: FnOnce(&SessionInfo) -> R,
{
let session_index = runtime.get_session_index_for_child(ctx.sender(), parent).await?;
if let Some(o_info) = self.session_info_cache.get(&session_index) {
tracing::trace!(target: LOG_TARGET, session_index, "Got session from lru");
return Ok(Some(with_info(o_info)))