Fixed closing of cache storage
#KTIJ-7680 Fixed #KT-45843 Fixed
This commit is contained in:
committed by
teamcityserver
parent
886ce055f5
commit
ee45aa6b08
@@ -47,7 +47,8 @@ abstract class BasicMap<K : Comparable<K>, V>(
|
|||||||
storage.flush(memoryCachesOnly)
|
storage.flush(memoryCachesOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun close() {
|
// avoid unsynchronized close
|
||||||
|
internal fun close() {
|
||||||
storage.close()
|
storage.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,11 @@ class CachingLazyStorage<K, V>(
|
|||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun close() {
|
override fun close() {
|
||||||
storage?.close()
|
try {
|
||||||
|
storage?.close()
|
||||||
|
} finally {
|
||||||
|
storage = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createMap(): PersistentHashMap<K, V> = PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
private fun createMap(): PersistentHashMap<K, V> = PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
||||||
|
|||||||
@@ -100,7 +100,11 @@ class NonCachingLazyStorage<K, V>(
|
|||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun close() {
|
override fun close() {
|
||||||
storage?.close()
|
try {
|
||||||
|
storage?.close()
|
||||||
|
} finally {
|
||||||
|
storage = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createMap(): PersistentHashMap<K, V> =
|
private fun createMap(): PersistentHashMap<K, V> =
|
||||||
|
|||||||
Reference in New Issue
Block a user