Skip to content

Commit 6d8570b

Browse files
committed
Flush in get_many to ensure updated cache
Signed-off-by: Darwin Boersma <[email protected]>
1 parent 8db1174 commit 6d8570b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/factor-key-value/src/util.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ impl Store for CachingStore {
251251
keys: Vec<String>,
252252
) -> anyhow::Result<Vec<(String, Option<Vec<u8>>)>, Error> {
253253
let mut state = self.state.lock().await;
254+
255+
// Flush any outstanding writes first in case entries have been popped off the end of the LRU cache prior
256+
// to their corresponding writes reaching the backing store.
257+
state.flush().await?;
258+
254259
let mut found: Vec<(String, Option<Vec<u8>>)> = Vec::new();
255260
let mut not_found: Vec<String> = Vec::new();
256261
for key in keys {

0 commit comments

Comments
 (0)