Open lzming9511 opened 1 month ago
` public Cache<String, String> kvCache; @PostConstruct public void init() { QuickConfig kvQc = QuickConfig.newBuilder("kvCache") .expire(Duration.ofHours(72)) .cacheType(CacheType.BOTH) // 创建一个两级缓存 .localLimit(500000) // 本地缓存元素个数限制,只对CacheType.LOCAL和CacheType.BOTH有效 .build(); kvCache = cacheManager.getOrCreateCache(kvQc); }
@Async public void clearKvCacheAsync() { kvCache.removeAll(*****);//要删除所有的缓存 }
`
没有你想要的那种接口
` public Cache<String, String> kvCache; @PostConstruct public void init() { QuickConfig kvQc = QuickConfig.newBuilder("kvCache") .expire(Duration.ofHours(72)) .cacheType(CacheType.BOTH) // 创建一个两级缓存 .localLimit(500000) // 本地缓存元素个数限制,只对CacheType.LOCAL和CacheType.BOTH有效 .build(); kvCache = cacheManager.getOrCreateCache(kvQc); }
@Async public void clearKvCacheAsync() { kvCache.removeAll(*****);//要删除所有的缓存 }
`