fix(engine-room): usa 127.0.0.1 e adiciona logs
- Troca localhost por 127.0.0.1 (mais confiável) - Adiciona logs para debugar chamadas ao Registry Refs: engine-room, registry, debug
This commit is contained in:
parent
fcfce87df8
commit
b0a8e73f67
|
|
@ -13,17 +13,24 @@ async function fetchRegistryServices(): Promise<any[] | null> {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), 3000);
|
const timeout = setTimeout(() => controller.abort(), 3000);
|
||||||
|
|
||||||
const response = await fetch('http://localhost:5001/api/registry/services', {
|
// Tenta 127.0.0.1 primeiro (mais confiável que localhost)
|
||||||
|
const response = await fetch('http://127.0.0.1:5001/api/registry/services', {
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
});
|
});
|
||||||
|
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
if (!response.ok) return null;
|
if (!response.ok) {
|
||||||
|
console.log('[Engine Room] Registry retornou:', response.status);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return data.success && Array.isArray(data.data?.services) ? data.data.services : null;
|
const services = data.success && Array.isArray(data.data?.services) ? data.data.services : null;
|
||||||
} catch {
|
console.log(`[Engine Room] Registry retornou ${services?.length || 0} serviços`);
|
||||||
|
return services;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[Engine Room] Erro ao consultar Registry:', error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue