The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as Semaphore from "effect/Semaphore"; |
| 3 | |
| 4 | // IAM rejects uploading the same signing certificate body anywhere else in |
| 5 | // the account, even when the certificates belong to different users. The two |
| 6 | // live tests intentionally share one checked-in deterministic certificate, so |
| 7 | // serialize only their certificate lifecycles while leaving unrelated IAM and |
| 8 | // AWS tests concurrent. |
| 9 | const signingCertificateFixtureLock = Semaphore.makeUnsafe(1); |
| 10 | |
| 11 | export const withSigningCertificateFixture = <A, E, R>(effect: Effect.Effect<A, E, R>) => |
| 12 | Effect.acquireUseRelease( |
| 13 | signingCertificateFixtureLock.take(1), |
| 14 | () => effect, |
| 15 | () => signingCertificateFixtureLock.release(1).pipe(Effect.asVoid), |
| 16 | ); |