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

Function runCommitHooks

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

Source from the content-addressed store, hash-verified

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

Callers 1

transactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected