From 06fe8af1fb4ff7f24d3abf922ac87b0511b8f235 Mon Sep 17 00:00:00 2001 From: Jonas Pacheco Date: Fri, 3 Apr 2026 17:40:01 -0300 Subject: [PATCH] fix(engine-room): URLs corretas para health check de containers externos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adiciona getEngineHealthUrl() para resolver URLs dinamicamente - MetaSet (Superset) usa SUPERSET_HOST ou 'superset' por padrão - Plus usa PLUS_HOST ou 'localhost' por padrão - Resolve problema de localhost:8088 falhar para Superset --- server/engine-room/routes.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server/engine-room/routes.ts b/server/engine-room/routes.ts index 2abf751..861e7d1 100644 --- a/server/engine-room/routes.ts +++ b/server/engine-room/routes.ts @@ -89,8 +89,24 @@ const ENGINES: EngineConfig[] = [ }, ]; +// Helper para obter URL de health check - considera containers externos +function getEngineHealthUrl(engine: EngineConfig): string { + // MetaSet/Superset roda em container separado + if (engine.name === "metaset") { + const supersetHost = process.env.SUPERSET_HOST || "superset"; + return `http://${supersetHost}:${engine.port}${engine.healthPath}`; + } + // Plus também roda externamente (quando instalado) + if (engine.name === "plus") { + const plusHost = process.env.PLUS_HOST || "localhost"; + return `http://${plusHost}:${engine.port}${engine.healthPath}`; + } + // Padrão: localhost (para compatibilidade) + return `http://localhost:${engine.port}${engine.healthPath}`; +} + async function checkEngineHealth(engine: EngineConfig): Promise { - const url = `http://localhost:${engine.port}${engine.healthPath}`; + const url = getEngineHealthUrl(engine); const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 5000);