🔖 Releasing / Version tags. v2.1.0
This commit is contained in:
1 parent
f484b09395
commit
58b25756e7
34 files changed
+155
-173
No files matched your search
+5
-4
@@ -53,20 +53,21 @@ public class RedisAutoCacheManager extends RedisCacheManager {
|
||||
if (StrUtil.isBlank(name) || !name.contains(SPLIT_FLAG)) {
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
|
||||
String[] cacheArray = name.split(SPLIT_FLAG);
|
||||
if (cacheArray.length < CACHE_LENGTH) {
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
String cacheName = cacheArray[0] + ":" + TenantContextHolder.getTenantId();
|
||||
|
||||
if (cacheConfig != null) {
|
||||
long cacheAge = Long.getLong(cacheArray[1], -1);
|
||||
long cacheAge = Long.parseLong(cacheArray[1]);
|
||||
cacheConfig = cacheConfig.entryTtl(Duration.ofSeconds(cacheAge));
|
||||
}
|
||||
return super.createRedisCache(cacheName, cacheConfig);
|
||||
return super.createRedisCache(name, cacheConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cache getCache(String name) {
|
||||
return super.getCache(name + ":" + TenantContextHolder.getTenantId());
|
||||
return super.getCache(name + SPLIT_FLAG + TenantContextHolder.getTenantId());
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -75,11 +75,9 @@ public class RedisCacheAutoConfiguration {
|
||||
cacheNames.forEach(it -> cacheConfigMap.put(it, cacheConfiguration));
|
||||
initialCaches.putAll(cacheConfigMap);
|
||||
}
|
||||
boolean allowInFlightCacheCreation = true;
|
||||
boolean enableTransactions = false;
|
||||
RedisAutoCacheManager cacheManager = new RedisAutoCacheManager(redisCacheWriter, cacheConfiguration,
|
||||
initialCaches, allowInFlightCacheCreation);
|
||||
cacheManager.setTransactionAware(enableTransactions);
|
||||
initialCaches, true);
|
||||
cacheManager.setTransactionAware(false);
|
||||
return this.customizerInvoker.customize(cacheManager);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user