diff options
Diffstat (limited to 'u/server/activity/health.ts')
-rw-r--r-- | u/server/activity/health.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/u/server/activity/health.ts b/u/server/activity/health.ts index 83be399..b9dedf9 100644 --- a/u/server/activity/health.ts +++ b/u/server/activity/health.ts @@ -38,10 +38,10 @@ export class HealthCheckActivityImpl implements IHealthCheckActivity { .flatMap((r) => r.move(HealthCheckInput.CHECK).map(this.check)) .peek( TraceUtil.promiseify((h) => - h.get().fold((err) => { - if (err) { + h.get().fold(({ isLeft, value }) => { + if (isLeft) { h.trace.trace(healthCheckMetric.failure); - h.trace.addTrace(LogLevel.ERROR).trace(`${err}`); + h.trace.addTrace(LogLevel.ERROR).trace(`${value}`); return; } h.trace.trace(healthCheckMetric.success); @@ -57,9 +57,9 @@ export class HealthCheckActivityImpl implements IHealthCheckActivity { () => "think im healthy!! (✿˘◡˘) ready to do work~", ) .fold( - (errMsg, okMsg) => - new JsonResponse(req, errMsg ?? okMsg, { - status: errMsg ? 500 : 200, + ({ isLeft, value: message }) => + new JsonResponse(req, message, { + status: isLeft ? 500 : 200, }), ), ), |