Skip to content

Commit 85d76cc

Browse files
committed
fix(server): refresh branch pull request lookups every minute
1 parent 9eebe09 commit 85d76cc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎apps/server/src/git/GitManager.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ const SHORT_SHA_LENGTH = 7;
120120
const TOAST_DESCRIPTION_MAX = 72;
121121
const STATUS_RESULT_CACHE_TTL = Duration.seconds(1);
122122
const STATUS_RESULT_CACHE_CAPACITY = 2_048;
123-
const PR_LOOKUP_CACHE_TTL = Duration.minutes(2);
123+
// Matches the automatic settlement sweep cadence so every background sweep
124+
// reads fresh branch state: an external merge settles within about a minute
125+
// instead of waiting out a longer cache. Unpublished branches never reach the
126+
// host (a local probe answers first), and failed lookups still back off
127+
// exponentially via prLookupFailureTtl, so throttling pressure still drops
128+
// under 429s instead of amplifying it.
129+
const PR_LOOKUP_CACHE_TTL = Duration.seconds(60);
124130
const PR_LOOKUP_FAILURE_BASE_TTL = Duration.seconds(20);
125131
const PR_LOOKUP_FAILURE_MAX_TTL = Duration.minutes(15);
126132
const PR_LOOKUP_CACHE_CAPACITY = 2_048;

0 commit comments

Comments
 (0)