From f54f3bf7d112495e54969a0ac9fcd013998a6a7d Mon Sep 17 00:00:00 2001 From: cryscan Date: Thu, 2 Nov 2023 22:57:12 +0800 Subject: [PATCH] Insert cached item back after checking out. --- src/run.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/run.rs b/src/run.rs index 7964f43f..ff04c25d 100644 --- a/src/run.rs +++ b/src/run.rs @@ -315,6 +315,10 @@ where .with_chunk_size(STATE_CHUNK_SIZE) .build_backed() }); + if len > 0 { + let key = Tokens(prefix.clone()); + cache.insert(key, reload.clone()); + } (prefix, reload) }; @@ -407,7 +411,7 @@ where if let Some(backed) = match &slots[batch] { SlotState::Idle(content, _) => { - log::info!("manually backed slot {}", batch); + log::info!("backed slot {}", batch); let backed = self.state.back_batch(batch).expect("back state"); cache.insert(content.clone(), backed.clone()); Some(backed)