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

Function trackExecution

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

Source from the content-addressed store, hash-verified

160 );
161
162 const trackExecution = (organizationId: string) =>
163 Effect.gen(function* () {
164 yield* Effect.annotateCurrentSpan({ "autumn.customer.id": organizationId });
165 yield* withProvisionedCustomer(
166 organizationId,
167 use((c) => c.track({ customerId: organizationId, featureId: "executions", value: 1 })),
168 ).pipe(
169 Effect.catch((error) =>
170 Effect.gen(function* () {
171 // Silent billing data loss is worth paging on: autumn.trackExecution
172 // is fire-and-forget so the caller doesn't handle it themselves.
173 yield* Effect.sync(() => {
174 console.error("[billing] track failed:", error);
175 });
176 yield* captureCauseEffect(error);
177 yield* Effect.annotateCurrentSpan({ "autumn.track.failed": true });
178 }),
179 ),
180 );
181 }).pipe(Effect.withSpan("autumn.trackExecution"));
182
183 const setMemberSeats = (organizationId: string, seats: number) =>
184 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