fix(configuration): 修复缓存无法自动选择

This commit is contained in:
2023-06-02 17:25:41 +08:00
parent a894484a4c
commit 3ab16253d4

View File

@@ -9,6 +9,7 @@ import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.caffeine.CaffeineCacheManager; import org.springframework.cache.caffeine.CaffeineCacheManager;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
/** /**
* 缓存提供 * 缓存提供
@@ -21,6 +22,7 @@ import org.springframework.context.annotation.Configuration;
public class CacheProvider { public class CacheProvider {
private static final Logger logger = LoggerFactory.getLogger(CacheProvider.class); private static final Logger logger = LoggerFactory.getLogger(CacheProvider.class);
@Primary
@Bean("normal-cache") @Bean("normal-cache")
public CacheManager normalCache() { public CacheManager normalCache() {
CaffeineCacheManager manager = new CaffeineCacheManager(); CaffeineCacheManager manager = new CaffeineCacheManager();