diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-06-20 14:53:38 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-06-20 14:53:38 -0700 |
commit | d4791f3d357634daf506fb8f91cc5332a794c421 (patch) | |
tree | 1bb01d2d4d8fa74d83bb6f99f2c8aa4146ca2d11 /server/health.ts | |
parent | d7e8d31c94cd713a2f4cf799e20e993acc69e361 (diff) | |
download | ci-d4791f3d357634daf506fb8f91cc5332a794c421.tar.gz ci-d4791f3d357634daf506fb8f91cc5332a794c421.zip |
Move to nodejs
Diffstat (limited to 'server/health.ts')
-rw-r--r-- | server/health.ts | 48 |
1 files changed, 20 insertions, 28 deletions
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<HealthCheckInput, ServerTrace>, + input: ITraceable<HealthCheckInput, ServerTrace>, ): Promise<IEither<Error, HealthCheckOutput>> => - 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(); |