gpt4 book ai didi

spring - RedisCacheManager 在代码中 Autowiring 但未按预期工作

转载 作者:可可西里 更新时间:2023-11-01 11:48:14 28 4
gpt4 key购买 nike

我在使用 spring 的 Redis 中使用 @Cacheable(value="bus_availability", key="#sourceCity") spring 注释来缓存数据。但是每当尝试使用 RedisCacheManager 访问它时,我都没有得到结果。就像 redisCacheManager.getCacheNames() 返回空数组一样。

最佳答案

我做了一些研究并解决了这个问题。我从同一个类调用方法,所以代理概念不适用于 bean。所以现在我把它移到另一个 bean 中,它现在工作正常

关于spring - RedisCacheManager 在代码中 Autowiring 但未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43803912/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com