@Cacheable在同一个类中方法调用不起作用

2022-07-03 09:58:11

上述图片中,同一个类中genLiveBullets()方法调用同类中的queryLiveByRoom()方法,这样即便标识了Cacheable标签,再次调用时也没有走缓存。cacheable不支持内部方法调用的方式,需要修改为把请求缓存的改成service方式,Aservice中的genLiveBullets()调用Bservice中的queryLiveByRoom(),见下图,已测试再次调用时为走的缓存。


  • 作者:seapeak007
  • 原文链接:https://blog.csdn.net/seapeak007/article/details/75031400
    更新时间:2022-07-03 09:58:11