mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 16:44:15 +08:00
Merge pull request #105 from im47cn/fix/task-reconnect-cleanup
fix(optimizer): SSE 放弃时清 localStorage + JSON 解析失败告警
This commit is contained in:
@@ -681,10 +681,13 @@ async def optimize_stream(
|
||||
try:
|
||||
base_params = json.loads(params) if params else {}
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
# 静默降级会让"用户配置丢失"变成无声 bug: 至少 warn 供诊断 (前端应传合法 JSON)。
|
||||
logger.warning("optimize: params JSON 解析失败, 降级为空 params: %r", params)
|
||||
base_params = {}
|
||||
try:
|
||||
ov = json.loads(overrides) if overrides else None
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
logger.warning("optimize: overrides JSON 解析失败, 降级为 None: %r", overrides)
|
||||
ov = None
|
||||
ocfg = OptimizeConfig(
|
||||
strategy_id=strategy_id,
|
||||
|
||||
Reference in New Issue
Block a user