modify: 修复未找到如何 RPC 方法的问题
This commit is contained in:
@@ -244,9 +244,15 @@ def _discover_plugins() -> list[dict]:
|
||||
if not workers_section:
|
||||
continue
|
||||
|
||||
# 合并运行时 config: 整个 TOML 顶层 + [workers.config] 展平
|
||||
# 合并运行时 config:
|
||||
# 1. plugin_conf 顶层 (worker, worker.registration 等 gen_models 用)
|
||||
# 2. [workers] 节的注册字段展平 (type, module, factory, cleanup, count)
|
||||
# — 其中 type 被 chongming_worker.runtime.create_workers 用于匹配 RPC 方法
|
||||
# 3. [workers.config] 展平到顶层 (api_key, data_dir, heartbeat 等)
|
||||
workers_flat = {k: v for k, v in workers_section.items() if k != "config"}
|
||||
runtime_config = {
|
||||
**plugin_conf,
|
||||
**workers_flat,
|
||||
**workers_section.get("config", {}),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user