This commit is contained in:
薇薇安 2026-01-18 10:08:49 +08:00
parent 08356cb1e9
commit ed8b2cf473
2 changed files with 4 additions and 8 deletions

View File

@ -244,13 +244,6 @@ class ConfigManager:
def get(self, key, default=None):
"""获取配置值"""
# 1. 优先从Redis缓存读取最新
<<<<<<< Current (Your changes)
redis_value = self._get_from_redis(key)
if redis_value is not None:
# 同时更新本地缓存
self._cache[key] = redis_value
return redis_value
=======
# 注意只在Redis连接正常时尝试读取避免频繁连接失败
if self._redis_connected and self._redis_client:
redis_value = self._get_from_redis(key)
@ -258,7 +251,6 @@ class ConfigManager:
# 同时更新本地缓存
self._cache[key] = redis_value
return redis_value
>>>>>>> Incoming (Background Agent changes)
# 2. 从本地缓存读取
if key in self._cache:

View File

@ -411,6 +411,10 @@ class PositionManager:
if trade_id and DB_AVAILABLE and Trade:
try:
<<<<<<< Current (Your changes)
<<<<<<< Current (Your changes)
=======
from database.connection import db
>>>>>>> Incoming (Background Agent changes)
=======
from database.connection import db
>>>>>>> Incoming (Background Agent changes)