From d4791f3d357634daf506fb8f91cc5332a794c421 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 20 Jun 2025 14:53:38 -0700 Subject: Move to nodejs --- server/health.ts | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'server/health.ts') diff --git a/server/health.ts b/server/health.ts index e69077b..8435865 100644 --- a/server/health.ts +++ b/server/health.ts @@ -1,32 +1,24 @@ import { - getRequiredEnv, - getStdout, - type HealthChecker, - type HealthCheckInput, - HealthCheckOutput, - type IEither, - type ITraceable, - type ServerTrace, - TraceUtil, -} from "@emprespresso/pengueno"; + getRequiredEnv, + getStdout, + type HealthChecker, + type HealthCheckInput, + HealthCheckOutput, + type IEither, + type ITraceable, + type ServerTrace, + TraceUtil, +} from '@emprespresso/pengueno'; export const healthCheck: HealthChecker = ( - input: ITraceable, + input: ITraceable, ): Promise> => - input - .bimap(TraceUtil.withFunctionTrace(healthCheck)) - .move(getRequiredEnv("LAMINAR_HOST")) - // ensure LAMINAR_HOST is propagated to getStdout for other procedures - .map((tEitherEnv) => - tEitherEnv - .get() - .flatMapAsync((_hasEnv) => - getStdout(tEitherEnv.move(["laminarc", "show-jobs"])), - ), - ) - .map( - TraceUtil.promiseify((stdout) => - stdout.get().moveRight(HealthCheckOutput.YAASSSLAYQUEEN), - ), - ) - .get(); + input + .bimap(TraceUtil.withFunctionTrace(healthCheck)) + .move(getRequiredEnv('LAMINAR_HOST')) + // ensure LAMINAR_HOST is propagated to getStdout for other procedures + .map((tEitherEnv) => + tEitherEnv.get().flatMapAsync((_hasEnv) => getStdout(tEitherEnv.move(['laminarc', 'show-jobs']))), + ) + .map(TraceUtil.promiseify((stdout) => stdout.get().moveRight(HealthCheckOutput.YAASSSLAYQUEEN))) + .get(); -- cgit v1.2.3-70-g09d2