Commit 5410a7ce by 王祖波

Merge branch 'feature-chat-activity' into 'master'

移除缓存

See merge request !2323
parents 488c77c3 e28b786f
......@@ -44,6 +44,12 @@ public class ImageCombined {
private static final Cache<String, BufferedImage> imageCache = Caffeine.newBuilder()
.maximumWeight(100 * 1024 * 1024) // 100MB
.weigher((String key, BufferedImage image) -> image.getWidth() * image.getHeight() * 3)
.removalListener((key, value, cause) -> {
logger.info("移除缓存:{}",key);
if (value != null) {
value.flush();
}
})
.expireAfterAccess(10, TimeUnit.MINUTES) // 可设置失效时间
.build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment