update
This commit is contained in:
parent
881f75590c
commit
466ff60b57
@ -667,7 +667,6 @@ _crypto_agent: Optional['CryptoAgent'] = None
|
||||
|
||||
def get_crypto_agent() -> 'CryptoAgent':
|
||||
"""获取加密货币智能体单例"""
|
||||
global _crypto_agent
|
||||
if _crypto_agent is None:
|
||||
_crypto_agent = CryptoAgent()
|
||||
return _crypto_agent
|
||||
# 直接使用类单例,不使用全局变量(避免 reload 时重置)
|
||||
return CryptoAgent()
|
||||
|
||||
|
||||
@ -217,7 +217,6 @@ _price_monitor_service: Optional[PriceMonitorService] = None
|
||||
|
||||
def get_price_monitor_service() -> PriceMonitorService:
|
||||
"""获取价格监控服务单例"""
|
||||
global _price_monitor_service
|
||||
if _price_monitor_service is None:
|
||||
_price_monitor_service = PriceMonitorService()
|
||||
return _price_monitor_service
|
||||
# 直接使用类单例,不使用全局变量(避免 reload 时重置)
|
||||
return PriceMonitorService()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user