mirror of https://github.com/usbharu/Hideout.git
fix: #184 ResourceResolverで利用しているCacheManagerで例外が発生した場合にロックが解放されないバグを修正
This commit is contained in:
parent
5a77b9e669
commit
e1d99b7ea9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue