Skip to content

Commit a753a0f

Browse files
t3dotggclaude
andcommitted
fix(server): checks and watch fingerprints keep their 15-second cache
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 60e0588 commit a753a0f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/server/src/pullRequest/PullRequestService.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ const DETAIL_CACHE_TTL = Duration.seconds(60);
145145
const MERGED_DETAIL_CACHE_TTL = Duration.minutes(10);
146146
const detailTimeToLive = (state: PullRequestState | undefined) =>
147147
state === "merged" ? MERGED_DETAIL_CACHE_TTL : DETAIL_CACHE_TTL;
148+
/**
149+
* Checks and the watch fingerprint stay short: they are how a running check's result reaches the
150+
* page and a watched pull request's change reaches its watch.
151+
*/
152+
const CHECKS_CACHE_TTL = Duration.seconds(15);
148153
const DIFF_CACHE_TTL = Duration.seconds(60);
149154
/** A commit is content-addressed, so its own diff cannot change under its key. */
150155
const COMMIT_DIFF_CACHE_TTL = Duration.minutes(10);
@@ -2971,7 +2976,7 @@ export const make = Effect.gen(function* () {
29712976
},
29722977
{
29732978
capacity: DETAIL_CACHE_CAPACITY,
2974-
timeToLive: (exit) => (Exit.isSuccess(exit) ? DETAIL_CACHE_TTL : Duration.zero),
2979+
timeToLive: (exit) => (Exit.isSuccess(exit) ? CHECKS_CACHE_TTL : Duration.zero),
29752980
},
29762981
);
29772982

@@ -2995,7 +3000,7 @@ export const make = Effect.gen(function* () {
29953000
},
29963001
{
29973002
capacity: DETAIL_CACHE_CAPACITY,
2998-
timeToLive: (exit) => (Exit.isSuccess(exit) ? DETAIL_CACHE_TTL : Duration.zero),
3003+
timeToLive: (exit) => (Exit.isSuccess(exit) ? CHECKS_CACHE_TTL : Duration.zero),
29993004
},
30003005
);
30013006

0 commit comments

Comments
 (0)