fixing(Gateway)
This commit is contained in:
+3
-3
@@ -88,9 +88,9 @@ class JacksonCacheSerializer : CacheSerializer {
|
||||
if (key != other.key) return false
|
||||
if (!valueBytes.contentEquals(other.valueBytes)) return false
|
||||
if (valueType != other.valueType) return false
|
||||
if (createdAt != other.createdAt) return false
|
||||
if (expiresAt != other.expiresAt) return false
|
||||
if (lastModifiedAt != other.lastModifiedAt) return false
|
||||
if (!createdAt.equals(other.createdAt)) return false
|
||||
if (expiresAt != other.expiresAt && expiresAt?.equals(other.expiresAt) != true) return false
|
||||
if (!lastModifiedAt.equals(other.lastModifiedAt)) return false
|
||||
if (isDirty != other.isDirty) return false
|
||||
if (isLocal != other.isLocal) return false
|
||||
|
||||
|
||||
+6
@@ -57,6 +57,7 @@ class RedisDistributedCache(
|
||||
localCache.remove(prefixedKey)
|
||||
return null
|
||||
}
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return localEntry.value as T?
|
||||
}
|
||||
|
||||
@@ -71,6 +72,7 @@ class RedisDistributedCache(
|
||||
val entry = serializer.deserializeEntry(bytes, clazz)
|
||||
|
||||
// Store in a local cache
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
localCache[prefixedKey] = entry as CacheEntry<Any>
|
||||
|
||||
return entry.value
|
||||
@@ -94,6 +96,7 @@ class RedisDistributedCache(
|
||||
expiresAt = expiresAt
|
||||
)
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
localCache[prefixedKey] = entry as CacheEntry<Any>
|
||||
|
||||
if (!isConnected()) {
|
||||
@@ -179,6 +182,7 @@ class RedisDistributedCache(
|
||||
// Get from the local cache first
|
||||
val prefixedKeys = keys.map { addPrefix(it) }
|
||||
val localEntries = prefixedKeys.mapNotNull { key ->
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val entry = localCache[key] as? CacheEntry<T>
|
||||
if (entry != null && !entry.isExpired()) {
|
||||
key to entry.value
|
||||
@@ -211,6 +215,7 @@ class RedisDistributedCache(
|
||||
val entry = serializer.deserializeEntry(bytes, clazz)
|
||||
|
||||
// Store in a local cache
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
localCache[key] = entry as CacheEntry<Any>
|
||||
|
||||
// Add to result
|
||||
@@ -242,6 +247,7 @@ class RedisDistributedCache(
|
||||
value = value,
|
||||
expiresAt = expiresAt
|
||||
)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
localCache[prefixedKey] = entry as CacheEntry<Any>
|
||||
redisBatch[prefixedKey] = serializer.serializeEntry(entry)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user