mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:30:43 +00:00
perf(cli): avoid runtime config loads in gateway discover
This commit is contained in:
@@ -72,6 +72,7 @@ vi.mock("../../commands/health.js", () => ({
|
||||
|
||||
vi.mock("../../config/read-best-effort-config.runtime.js", () => ({
|
||||
readBestEffortConfig: async () => ({}),
|
||||
readSourceConfigBestEffort: async () => ({}),
|
||||
}));
|
||||
|
||||
vi.mock("../../infra/bonjour-discovery.js", () => ({
|
||||
|
||||
@@ -265,7 +265,7 @@ export function registerGatewayCli(program: Command) {
|
||||
.action(async (opts: GatewayDiscoverOpts) => {
|
||||
await runGatewayCommand(async () => {
|
||||
const [
|
||||
{ readBestEffortConfig },
|
||||
{ readSourceConfigBestEffort },
|
||||
{ discoverGatewayBeacons },
|
||||
{ resolveWideAreaDiscoveryDomain },
|
||||
] = await Promise.all([
|
||||
@@ -273,7 +273,7 @@ export function registerGatewayCli(program: Command) {
|
||||
loadBonjourDiscoveryModule(),
|
||||
loadWideAreaDnsModule(),
|
||||
]);
|
||||
const cfg = await readBestEffortConfig();
|
||||
const cfg = await readSourceConfigBestEffort();
|
||||
const wideAreaDomain = resolveWideAreaDiscoveryDomain({
|
||||
configDomain: cfg.discovery?.wideArea?.domain,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user