Skip to content

Commit 65f43f0

Browse files
committed
Make refresh/refreshAll suspending
1 parent 13650e1 commit 65f43f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aedile-core/src/main/kotlin/com/sksamuel/aedile/core/LoadingCache.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ class LoadingCache<K, V>(
181181
*
182182
* See full docs at [com.github.benmanes.caffeine.cache.LoadingCache.refresh].
183183
*/
184-
fun refresh(key: K) {
185-
cache.synchronous().refresh(key)
184+
suspend fun refresh(key: K) {
185+
cache.synchronous().refresh(key).await()
186186
}
187187

188188
/**
@@ -191,8 +191,8 @@ class LoadingCache<K, V>(
191191
*
192192
* See full docs at [com.github.benmanes.caffeine.cache.LoadingCache.refreshAll].
193193
*/
194-
fun refreshAll(keys: Collection<K>) {
195-
cache.synchronous().refreshAll(keys)
194+
suspend fun refreshAll(keys: Collection<K>) {
195+
cache.synchronous().refreshAll(keys).await()
196196
}
197197

198198
private suspend fun scope(): CoroutineScope {

0 commit comments

Comments
 (0)