From f618026305758b1e4517224006b4b7ab19fa08d6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 2 May 2018 19:14:26 +0200 Subject: [PATCH] Add store cache flushing after each 100st entry --- bin/core/imag-ids/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index 308a56aa..c8da3cef 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -91,6 +91,14 @@ fn main() { .entries() .map_err_trace_exit_unwrap(1) .trace_unwrap_exit(1) + .enumerate() + .map(|(i, e)| { + if i % 100 == 0 { + let _ = rt.store().flush_cache(); + } + + e + }) .filter(|id| collection_filter.filter(id)) .filter(|id| match query_filter.as_ref() { None => true,