diff options
author | Elizabeth <me@liz.coffee> | 2025-06-02 18:55:32 -0700 |
---|---|---|
committer | Elizabeth <me@liz.coffee> | 2025-06-02 18:55:32 -0700 |
commit | a16fbd3eaa165b3226a3b0ed9848b51718aaeafa (patch) | |
tree | c12f09a3deb8d33d166480577d9b1223462ee295 /server | |
parent | ba8e70d9082f193df47ab866a59636e63c31970e (diff) | |
download | ci-a16fbd3eaa165b3226a3b0ed9848b51718aaeafa.tar.gz ci-a16fbd3eaa165b3226a3b0ed9848b51718aaeafa.zip |
Fixes when the map of an either is expected to be possible undefined
Diffstat (limited to 'server')
-rw-r--r-- | server/health.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/health.ts b/server/health.ts index 1acc074..8fbc69d 100644 --- a/server/health.ts +++ b/server/health.ts @@ -17,12 +17,9 @@ export const healthCheck: HealthChecker = ( .bimap(TraceUtil.withFunctionTrace(healthCheck)) .move(getRequiredEnv("LAMINAR_HOST")) // ensure LAMINAR_HOST is propagated to getStdout for other procedures - .map((e) => e.get().moveRight(["laminarc", "show-jobs"])) - .map((i) => - i - .get() - .mapRight(i.move.apply) - .flatMapAsync(getStdout.apply) - .then((gotJobs) => gotJobs.moveRight(HealthCheckOutput.YAASSSLAYQUEEN)), - ) + .map((tEitherEnv) => tEitherEnv.get() + .flatMapAsync((_hasEnv) => + getStdout(tEitherEnv.move(["laminarc", "show-jobs"])) + )) + .map(TraceUtil.promiseify((stdout) => stdout.get().moveRight(HealthCheckOutput.YAASSSLAYQUEEN))) .get(); |