fix(configuration): 修复缓存无法自动选择
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user