(organizationId: string)
| 260 | ); |
| 261 | |
| 262 | const trackExecution = (organizationId: string) => |
| 263 | Effect.gen(function* () { |
| 264 | yield* Effect.annotateCurrentSpan({ "autumn.customer.id": organizationId }); |
| 265 | yield* withProvisionedCustomer( |
| 266 | organizationId, |
| 267 | use((c) => c.track({ customerId: organizationId, featureId: "executions", value: 1 })), |
| 268 | ).pipe( |
| 269 | Effect.catch((error) => |
| 270 | Effect.gen(function* () { |
| 271 | // Silent billing data loss is worth paging on: autumn.trackExecution |
| 272 | // is fire-and-forget so the caller doesn't handle it themselves. |
| 273 | yield* Effect.sync(() => { |
| 274 | console.error("[billing] track failed"); |
| 275 | }); |
| 276 | yield* captureCauseEffect(error); |
| 277 | yield* Effect.annotateCurrentSpan({ "autumn.track.failed": true }); |
| 278 | }), |
| 279 | ), |
| 280 | ); |
| 281 | }).pipe(Effect.withSpan("autumn.trackExecution")); |
| 282 | |
| 283 | const setMemberSeats = (organizationId: string, seats: number) => |
| 284 | Effect.gen(function* () { |
nothing calls this directly
no test coverage detected