diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-05-02 19:14:26 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-05-02 20:42:56 +0200 |
commit | f618026305758b1e4517224006b4b7ab19fa08d6 (patch) | |
tree | 607754819dea316bf3fa0c907c543f9108865bba /bin | |
parent | c27349e94f845feecd686da7c344fe20d4799bd1 (diff) |
Add store cache flushing after each 100st entry
Diffstat (limited to 'bin')
-rw-r--r-- | bin/core/imag-ids/src/main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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, |