Skip to content

Commit 6f0b32d

Browse files
Use Layer.succeed for the pure ApnsProviderTokens construction
Fixes the Effect Service Conventions check: the service builds a plain object with no effectful acquisition, so wrapping it in Effect.sync just to feed Layer.effect was the make-only-to-force-Layer.effect shape the conventions call out. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent be4e710 commit 6f0b32d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎infra/relay/src/agentActivity/ApnsProviderTokens.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function quantizedApnsJwtIssuedAt(nowUnixSeconds: number): number {
4545
return Math.floor(nowUnixSeconds / APNS_JWT_REUSE_SECONDS) * APNS_JWT_REUSE_SECONDS;
4646
}
4747

48-
export const make = Effect.sync(() =>
48+
export const make = () =>
4949
ApnsProviderTokens.of({
5050
getJwt: Effect.fnUntraced(function* (input) {
5151
const issuedAtUnixSeconds = quantizedApnsJwtIssuedAt(input.issuedAtUnixSeconds);
@@ -58,7 +58,6 @@ export const make = Effect.sync(() =>
5858
isolateTokenCache.set(cacheKey, { jwt, issuedAtUnixSeconds });
5959
return jwt;
6060
}),
61-
}),
62-
);
61+
});
6362

64-
export const layer = Layer.effect(ApnsProviderTokens, make);
63+
export const layer = Layer.succeed(ApnsProviderTokens, make());

0 commit comments

Comments
 (0)