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 /u/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 'u/server')
-rw-r--r-- | u/server/activity/health.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/u/server/activity/health.ts b/u/server/activity/health.ts index b9dedf9..3b4a23a 100644 --- a/u/server/activity/health.ts +++ b/u/server/activity/health.ts @@ -35,16 +35,18 @@ export class HealthCheckActivityImpl implements IHealthCheckActivity { return req .bimap(TraceUtil.withFunctionTrace(this.checkHealth)) .bimap(TraceUtil.withMetricTrace(healthCheckMetric)) - .flatMap((r) => r.move(HealthCheckInput.CHECK).map(this.check)) + .flatMap((r) => + r.move(HealthCheckInput.CHECK).map((input) => this.check(input)), + ) .peek( TraceUtil.promiseify((h) => h.get().fold(({ isLeft, value }) => { - if (isLeft) { - h.trace.trace(healthCheckMetric.failure); - h.trace.addTrace(LogLevel.ERROR).trace(`${value}`); + if (!isLeft) { + h.trace.trace(healthCheckMetric.success); return; } - h.trace.trace(healthCheckMetric.success); + h.trace.trace(healthCheckMetric.failure); + h.trace.addTrace(LogLevel.ERROR).trace(`${value}`); }), ), ) |