mirror of
https://github.com/usbharu/Hideout.git
synced 2026-07-22 21:23:45 +00:00
fix: #184 ResourceResolverで利用しているCacheManagerで例外が発生した場合にロックが解放されないバグを修正
This commit is contained in:
@@ -29,7 +29,12 @@ class InMemoryCacheManager : CacheManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needRunBlock) {
|
if (needRunBlock) {
|
||||||
val processed = block()
|
val processed = try {
|
||||||
|
block()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
cacheKey.remove(key)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
|
||||||
if (cacheKey.containsKey(key)) {
|
if (cacheKey.containsKey(key)) {
|
||||||
valueStore[key] = processed
|
valueStore[key] = processed
|
||||||
|
|||||||
Reference in New Issue
Block a user