MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / runCommitHooks

Function runCommitHooks

packages/core/sdk/src/fuma-runtime.ts:282–294  ·  view source on GitHub ↗
(hooks: readonly PendingCommitHook[])

Source from the content-addressed store, hash-verified

280 );
281
282const runCommitHooks = (hooks: readonly PendingCommitHook[]): Effect.Effect<void, StorageFailure> =>
283 Effect.gen(function* () {
284 let failureCause: Cause.Cause<StorageFailure> = Cause.empty;
285 for (const hook of hooks) {
286 if (Predicate.isTagged(hook, "Observer")) {
287 yield* hook.effect.pipe(Effect.ignoreCause({ log: false }));
288 continue;
289 }
290 const exit = yield* Effect.exit(hook.effect);
291 if (Exit.isFailure(exit)) failureCause = Cause.combine(failureCause, exit.cause);
292 }
293 if (failureCause.reasons.length > 0) return yield* Effect.failCause(failureCause);
294 });
295
296class TransactionEffectFailure {
297 constructor(readonly error: unknown) {}

Callers 1

transactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected