a
This commit is contained in:
parent
08356cb1e9
commit
ed8b2cf473
|
|
@ -244,13 +244,6 @@ class ConfigManager:
|
||||||
def get(self, key, default=None):
|
def get(self, key, default=None):
|
||||||
"""获取配置值"""
|
"""获取配置值"""
|
||||||
# 1. 优先从Redis缓存读取(最新)
|
# 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连接正常时尝试读取,避免频繁连接失败
|
# 注意:只在Redis连接正常时尝试读取,避免频繁连接失败
|
||||||
if self._redis_connected and self._redis_client:
|
if self._redis_connected and self._redis_client:
|
||||||
redis_value = self._get_from_redis(key)
|
redis_value = self._get_from_redis(key)
|
||||||
|
|
@ -258,7 +251,6 @@ class ConfigManager:
|
||||||
# 同时更新本地缓存
|
# 同时更新本地缓存
|
||||||
self._cache[key] = redis_value
|
self._cache[key] = redis_value
|
||||||
return redis_value
|
return redis_value
|
||||||
>>>>>>> Incoming (Background Agent changes)
|
|
||||||
|
|
||||||
# 2. 从本地缓存读取
|
# 2. 从本地缓存读取
|
||||||
if key in self._cache:
|
if key in self._cache:
|
||||||
|
|
|
||||||
|
|
@ -411,6 +411,10 @@ class PositionManager:
|
||||||
if trade_id and DB_AVAILABLE and Trade:
|
if trade_id and DB_AVAILABLE and Trade:
|
||||||
try:
|
try:
|
||||||
<<<<<<< Current (Your changes)
|
<<<<<<< Current (Your changes)
|
||||||
|
<<<<<<< Current (Your changes)
|
||||||
|
=======
|
||||||
|
from database.connection import db
|
||||||
|
>>>>>>> Incoming (Background Agent changes)
|
||||||
=======
|
=======
|
||||||
from database.connection import db
|
from database.connection import db
|
||||||
>>>>>>> Incoming (Background Agent changes)
|
>>>>>>> Incoming (Background Agent changes)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user