ResponseCacheImpl.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:artemis-disruptor-miaosha 作者:
/**
 * 定时清理缓存, 5分钟
 */
@Scheduled(fixedDelay = 1000 * 60L * 5)
public void flush() {

  Long now = System.currentTimeMillis();

  RESPONSE_MAP.keySet().stream()
      .filter(s -> RESPONSE_MAP.get(s).getValue1() < now)
      .forEach(RESPONSE_MAP::remove);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号