debug: comenta createNode para isolate erro

This commit is contained in:
Jonas Pacheco 2026-03-31 15:59:00 -03:00
parent 5c0f3f818e
commit 50e419db17
1 changed files with 15 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import type { Express, Request, Response } from "express"; import type { Express, Request, Response } from "express";
import crypto from "crypto"; import crypto from "crypto";
import { createNode } from "../graph/service"; // import { createNode } from "../graph/service"; // TODO: debug - comentado temporariamente
const MIROFLOW_HOST = process.env.MIROFLOW_HOST || "localhost"; const MIROFLOW_HOST = process.env.MIROFLOW_HOST || "localhost";
const MIROFLOW_PORT = parseInt(process.env.MIROFLOW_PORT || "8006", 10); const MIROFLOW_PORT = parseInt(process.env.MIROFLOW_PORT || "8006", 10);
@ -34,6 +34,8 @@ async function proxyToMiroFlow(path: string, method: string = "GET", body?: obje
async function registerExecutionInKG(req: Request, execData: any, inputBody: any): Promise<void> { async function registerExecutionInKG(req: Request, execData: any, inputBody: any): Promise<void> {
try { try {
// TODO: debug - createNode comentado temporariamente
/*
const auditHash = crypto const auditHash = crypto
.createHash("sha256") .createHash("sha256")
.update(JSON.stringify({ .update(JSON.stringify({
@ -45,17 +47,18 @@ async function registerExecutionInKG(req: Request, execData: any, inputBody: any
})) }))
.digest("hex"); .digest("hex");
await createNode({ // await createNode({
type: "miroflow_execution", // type: "miroflow_execution",
tenantId: (req.user as any)?.tenantId ?? null, // tenantId: (req.user as any)?.tenantId ?? null,
data: { // data: {
...execData, // ...execData,
input: inputBody, // input: inputBody,
auditHash, // auditHash,
immutable: true, // immutable: true,
registeredAt: new Date().toISOString(), // registeredAt: new Date().toISOString(),
}, // },
}); // });
*/
} catch (kgErr: any) { } catch (kgErr: any) {
// KG failure não deve bloquear a resposta ao cliente // KG failure não deve bloquear a resposta ao cliente
console.error("[MiroFlow] Falha ao registrar no KG:", kgErr.message); console.error("[MiroFlow] Falha ao registrar no KG:", kgErr.message);