From e1d99b7ea9dc4b0ed28b4dafc6468f43f417d584 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sun, 3 Dec 2023 13:03:45 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20#184=20ResourceResolver=E3=81=A7?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E3=81=97=E3=81=A6=E3=81=84=E3=82=8BCacheMana?= =?UTF-8?q?ger=E3=81=A7=E4=BE=8B=E5=A4=96=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=97=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AB=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=8C=E8=A7=A3=E6=94=BE=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hideout/core/service/resource/InMemoryCacheManager.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/resource/InMemoryCacheManager.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/resource/InMemoryCacheManager.kt index 587829c9..d5ca028d 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/resource/InMemoryCacheManager.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/resource/InMemoryCacheManager.kt @@ -29,7 +29,12 @@ class InMemoryCacheManager : CacheManager { } } if (needRunBlock) { - val processed = block() + val processed = try { + block() + } catch (e: Exception) { + cacheKey.remove(key) + throw e + } if (cacheKey.containsKey(key)) { valueStore[key] = processed