diff --git a/apps/webapp/app/routes/engine.v1.dev.runs.$runFriendlyId.logs.debug.ts b/apps/webapp/app/routes/engine.v1.dev.runs.$runFriendlyId.logs.debug.ts index 9bdc4d16d2..4e24006025 100644 --- a/apps/webapp/app/routes/engine.v1.dev.runs.$runFriendlyId.logs.debug.ts +++ b/apps/webapp/app/routes/engine.v1.dev.runs.$runFriendlyId.logs.debug.ts @@ -11,64 +11,69 @@ import { logger } from "~/services/logger.server"; import { createActionApiRoute } from "~/services/routeBuilders/apiBuilder.server"; import { recordRunDebugLog } from "~/v3/eventRepository.server"; -const { action } = createActionApiRoute( - { - params: z.object({ - runFriendlyId: z.string(), - }), - body: WorkerApiDebugLogBody, - method: "POST", - }, - async ({ - authentication, - body, - params, - }): Promise> => { - const { runFriendlyId } = params; +// const { action } = createActionApiRoute( +// { +// params: z.object({ +// runFriendlyId: z.string(), +// }), +// body: WorkerApiDebugLogBody, +// method: "POST", +// }, +// async ({ +// authentication, +// body, +// params, +// }): Promise> => { +// const { runFriendlyId } = params; - try { - const run = await prisma.taskRun.findFirst({ - where: { - friendlyId: params.runFriendlyId, - runtimeEnvironmentId: authentication.environment.id, - }, - }); +// try { +// const run = await prisma.taskRun.findFirst({ +// where: { +// friendlyId: params.runFriendlyId, +// runtimeEnvironmentId: authentication.environment.id, +// }, +// }); - if (!run) { - throw new Response("You don't have permissions for this run", { status: 401 }); - } +// if (!run) { +// throw new Response("You don't have permissions for this run", { status: 401 }); +// } - const eventResult = await recordRunDebugLog( - RunId.fromFriendlyId(runFriendlyId), - body.message, - { - attributes: { - properties: body.properties, - }, - startTime: body.time, - } - ); +// const eventResult = await recordRunDebugLog( +// RunId.fromFriendlyId(runFriendlyId), +// body.message, +// { +// attributes: { +// properties: body.properties, +// }, +// startTime: body.time, +// } +// ); - if (eventResult.success) { - return new Response(null, { status: 204 }); - } +// if (eventResult.success) { +// return new Response(null, { status: 204 }); +// } - switch (eventResult.code) { - case "FAILED_TO_RECORD_EVENT": - return new Response(null, { status: 400 }); // send a 400 to prevent retries - case "RUN_NOT_FOUND": - return new Response(null, { status: 404 }); - default: - return assertExhaustive(eventResult.code); - } - } catch (error) { - logger.error("Failed to record dev log", { - environmentId: authentication.environment.id, - error, - }); - throw error; - } - } -); +// switch (eventResult.code) { +// case "FAILED_TO_RECORD_EVENT": +// return new Response(null, { status: 400 }); // send a 400 to prevent retries +// case "RUN_NOT_FOUND": +// return new Response(null, { status: 404 }); +// default: +// return assertExhaustive(eventResult.code); +// } +// } catch (error) { +// logger.error("Failed to record dev log", { +// environmentId: authentication.environment.id, +// error, +// }); +// throw error; +// } +// } +// ); -export { action }; +// export { action }; + +// Create a generic JSON action in remix +export function action() { + return new Response(null, { status: 204 }); +} diff --git a/apps/webapp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.logs.debug.ts b/apps/webapp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.logs.debug.ts index a814ae257f..127f9a3ff8 100644 --- a/apps/webapp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.logs.debug.ts +++ b/apps/webapp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.logs.debug.ts @@ -5,34 +5,39 @@ import { z } from "zod"; import { createActionWorkerApiRoute } from "~/services/routeBuilders/apiBuilder.server"; import { recordRunDebugLog } from "~/v3/eventRepository.server"; -export const action = createActionWorkerApiRoute( - { - params: z.object({ - runFriendlyId: z.string(), - }), - body: WorkerApiDebugLogBody, - }, - async ({ body, params }): Promise => { - const { runFriendlyId } = params; +// export const action = createActionWorkerApiRoute( +// { +// params: z.object({ +// runFriendlyId: z.string(), +// }), +// body: WorkerApiDebugLogBody, +// }, +// async ({ body, params }): Promise => { +// const { runFriendlyId } = params; - const eventResult = await recordRunDebugLog(RunId.fromFriendlyId(runFriendlyId), body.message, { - attributes: { - properties: body.properties, - }, - startTime: body.time, - }); +// const eventResult = await recordRunDebugLog(RunId.fromFriendlyId(runFriendlyId), body.message, { +// attributes: { +// properties: body.properties, +// }, +// startTime: body.time, +// }); - if (eventResult.success) { - return new Response(null, { status: 204 }); - } +// if (eventResult.success) { +// return new Response(null, { status: 204 }); +// } - switch (eventResult.code) { - case "FAILED_TO_RECORD_EVENT": - return new Response(null, { status: 400 }); // send a 400 to prevent retries - case "RUN_NOT_FOUND": - return new Response(null, { status: 404 }); - default: - return assertExhaustive(eventResult.code); - } - } -); +// switch (eventResult.code) { +// case "FAILED_TO_RECORD_EVENT": +// return new Response(null, { status: 400 }); // send a 400 to prevent retries +// case "RUN_NOT_FOUND": +// return new Response(null, { status: 404 }); +// default: +// return assertExhaustive(eventResult.code); +// } +// } +// ); + +// Create a generic JSON action in remix +export function action() { + return new Response(null, { status: 204 }); +} diff --git a/apps/webapp/app/routes/healthcheck.tsx b/apps/webapp/app/routes/healthcheck.tsx index 05c00945ae..13ca5037d9 100644 --- a/apps/webapp/app/routes/healthcheck.tsx +++ b/apps/webapp/app/routes/healthcheck.tsx @@ -1,9 +1,7 @@ -import { prisma } from "~/db.server"; import type { LoaderFunction } from "@remix-run/node"; export const loader: LoaderFunction = async ({ request }) => { try { - await prisma.user.count(); return new Response("OK"); } catch (error: unknown) { console.log("healthcheck ❌", { error });