diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:54:15 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:55:20 -0700 |
commit | d54e91c6582ed160cf2f2fcf977e48b4439d133b (patch) | |
tree | 5669367c4fa49bc0373b0c581ea3027218fd5e32 /hooks/server/health.ts | |
parent | 9cf3fc0259730b7dcf47b3ab4a04369e39fb4614 (diff) | |
download | ci-theBigRefactor.tar.gz ci-theBigRefactor.zip |
snapshottheBigRefactor
Diffstat (limited to 'hooks/server/health.ts')
-rw-r--r-- | hooks/server/health.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/hooks/server/health.ts b/hooks/server/health.ts index 41dfcb4..2f67aa4 100644 --- a/hooks/server/health.ts +++ b/hooks/server/health.ts @@ -1,23 +1,25 @@ import { getRequiredEnv, getStdout, + type HealthChecker, type HealthCheckInput, HealthCheckOutput, type IEither, type ITraceable, + type ServerTrace, TraceUtil, } from "@emprespresso/pengueno"; -export const healthCheck = <Trace>( - input: ITraceable<HealthCheckInput, Trace>, +export const healthCheck: HealthChecker = ( + input: ITraceable<HealthCheckInput, ServerTrace>, ): Promise<IEither<Error, HealthCheckOutput>> => input.bimap(TraceUtil.withFunctionTrace(healthCheck)) .move(getRequiredEnv("LAMINAR_HOST")) - // we need to test LAMINAR_HOST is propagated to getStdout for other procedures - .map(({ item }) => item.moveRight(["laminarc", "show-jobs"])) + // ensure LAMINAR_HOST is propagated to getStdout for other procedures + .map((e) => e.get().moveRight(["laminarc", "show-jobs"])) .map((i) => - i.item.mapRight(i.move.apply) + i.get().mapRight(i.move.apply) .flatMapAsync(getStdout.apply) - .then((gotJobs) => gotJobs.moveRight(HealthCheckOutput.YAASQUEEN)) + .then((gotJobs) => gotJobs.moveRight(HealthCheckOutput.YAASSSLAYQUEEN)) ) - .item; + .get(); |