File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,29 @@ def _normalize_plugin_mounts_strategy(raw_mounts_json: str | None) -> str | None
105105 if normalized != RUNTIME_SETTINGS .strategy_plugin_mounts_json :
106106 object .__setattr__ (RUNTIME_SETTINGS , "strategy_plugin_mounts_json" , normalized )
107107
108+ for _env_name in ("MONITOR_DISPATCH_TARGETS_JSON" , "LONGBRIDGE_MONITOR_DISPATCH_TARGETS_JSON" ):
109+ _raw = os .environ .get (_env_name )
110+ if _raw :
111+ try :
112+ _targets = json .loads (_raw )
113+ except json .JSONDecodeError :
114+ continue
115+ if not isinstance (_targets , dict ):
116+ continue
117+ _entries = _targets .get ("targets" )
118+ if not isinstance (_entries , list ):
119+ continue
120+ _changed = False
121+ for _entry in _entries :
122+ if isinstance (_entry , dict ):
123+ _old = _entry .get ("strategy_profile" )
124+ if _old and _old != STRATEGY_PROFILE :
125+ _entry ["strategy_profile" ] = STRATEGY_PROFILE
126+ _changed = True
127+ print (f"[config-sync] { _env_name } strategy_profile corrected: { _old } → { STRATEGY_PROFILE } " , flush = True )
128+ if _changed :
129+ os .environ [_env_name ] = json .dumps (_targets , ensure_ascii = False )
130+
108131ACCOUNT_REGION = RUNTIME_SETTINGS .account_region
109132MARKET = RUNTIME_SETTINGS .market
110133MARKET_CALENDAR = RUNTIME_SETTINGS .market_calendar
You can’t perform that action at this time.
0 commit comments