From caaddad0ed5d2461156b1cb10264e28e5a873c22 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 4 Apr 2022 20:22:27 +0100 Subject: [PATCH] Flush underlying Store when a Cache is flushed This ensures the buffered data in BufferedFileChannels is written to disk even if close() is never called. Signed-off-by: Graham --- cache/src/main/kotlin/org/openrs2/cache/Cache.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cache/src/main/kotlin/org/openrs2/cache/Cache.kt b/cache/src/main/kotlin/org/openrs2/cache/Cache.kt index 3899f91b..338a5fe5 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/Cache.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/Cache.kt @@ -227,6 +227,8 @@ public class Cache private constructor( for (archive in archives) { archive?.flush() } + + store.flush() } /**