diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-15 23:39:29 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-15 23:40:00 -0700 |
commit | 1ab20482ab37d7962c8e69701163270e687df3ca (patch) | |
tree | f0aaac54f8c23269fdeb2bca6f22e296a9e0559f /u/server/activity | |
parent | 3a3fb9c8ab0c798a278f76d40de216fa96f6e2c4 (diff) | |
download | ci-1ab20482ab37d7962c8e69701163270e687df3ca.tar.gz ci-1ab20482ab37d7962c8e69701163270e687df3ca.zip |
more snapshot
Diffstat (limited to 'u/server/activity')
-rw-r--r-- | u/server/activity/health.ts | 18 | ||||
-rw-r--r-- | u/server/activity/mod.ts | 2 |
2 files changed, 12 insertions, 8 deletions
diff --git a/u/server/activity/health.ts b/u/server/activity/health.ts index bf1f52c..7ee6629 100644 --- a/u/server/activity/health.ts +++ b/u/server/activity/health.ts @@ -1,25 +1,27 @@ import { - Either, - getRequiredEnv, - getStdout, + type IEither, type ITraceable, LogLevel, type Mapper, TraceUtil, } from "@emprespresso/pengueno"; -type HealthCheckInput = "healthy?"; -type HealthCheckOutput = "healthy!"; +export enum HealthCheckInput { + CHECK, +} +export enum HealthCheckOutput { + YAASQUEEN, +} -const HealthCheckActivity = <Trace>( +export const HealthCheckActivity = <Trace>( check: Mapper< ITraceable<HealthCheckInput, Trace>, - Promise<Either<Error, HealthCheckOutput>> + Promise<IEither<Error, HealthCheckOutput>> >, ) => (req: ITraceable<Request, Trace>) => req.bimap(TraceUtil.withFunctionTrace(HealthCheckActivity)) - .flatMap((r) => r.move(<HealthCheckInput> "healthy?")) + .flatMap((r) => r.move(HealthCheckInput.CHECK)) .map(check) .map(TraceUtil.promiseify(({ item: health, trace }) => { health.mapBoth((e) => { diff --git a/u/server/activity/mod.ts b/u/server/activity/mod.ts index 6908c26..9d05d3c 100644 --- a/u/server/activity/mod.ts +++ b/u/server/activity/mod.ts @@ -6,3 +6,5 @@ export class r200 extends Response { export interface IActivity<Trace> extends RequestFilter<r200, Trace> { } + +export * from "./health.ts"; |