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

Function trackExecution

apps/cloud/src/extensions/billing/service.ts:173–192  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

171 );
172
173 const trackExecution = (organizationId: string) =>
174 Effect.gen(function* () {
175 yield* Effect.annotateCurrentSpan({ "autumn.customer.id": organizationId });
176 yield* withProvisionedCustomer(
177 organizationId,
178 use((c) => c.track({ customerId: organizationId, featureId: "executions", value: 1 })),
179 ).pipe(
180 Effect.catch((error) =>
181 Effect.gen(function* () {
182 // Silent billing data loss is worth paging on: autumn.trackExecution
183 // is fire-and-forget so the caller doesn't handle it themselves.
184 yield* Effect.sync(() => {
185 console.error("[billing] track failed:", error);
186 });
187 yield* captureCauseEffect(error);
188 yield* Effect.annotateCurrentSpan({ "autumn.track.failed": true });
189 }),
190 ),
191 );
192 }).pipe(Effect.withSpan("autumn.trackExecution"));
193
194 const setMemberSeats = (organizationId: string, seats: number) =>
195 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 5

captureCauseEffectFunction · 0.90
withProvisionedCustomerFunction · 0.85
errorMethod · 0.80
useFunction · 0.70
syncMethod · 0.65

Tested by

no test coverage detected