(organizationId: string)
| 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* () { |
nothing calls this directly
no test coverage detected