redis key 精确到分钟
This commit is contained in:
parent
fe14f21626
commit
8cef39513a
@ -1228,8 +1228,10 @@ class FreqaiPrimer(IStrategy):
|
||||
# 生成统一的缓存键
|
||||
strategy_name = "freqaiprimer"
|
||||
timeframes_str = "3m-15m-1h"
|
||||
cache_key = f"{strategy_name}|trend_score|{pair.replace('/', '-')}|{timeframes_str}|{timestamp}"
|
||||
logger.debug(f"[{pair}] 生成缓存键:{cache_key} (时间戳: {timestamp})")
|
||||
# 将时间戳精度从秒改为分钟,去掉最后两位秒数
|
||||
minute_timestamp = int(timestamp // 60) * 60 # 向下取整到分钟
|
||||
cache_key = f"{strategy_name}|trend_score|{pair.replace('/', '-')}|{timeframes_str}|{minute_timestamp}"
|
||||
logger.debug(f"[{pair}] 生成缓存键:{cache_key} (时间戳: {minute_timestamp})")
|
||||
|
||||
# 🎯 一级缓存:本地内存检查
|
||||
if cache_key in self._local_cache:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user