Skip to content

Commit 54f6322

Browse files
committed
fix(server): extend negative repo identity cache ttl
1 parent 7a08fcf commit 54f6322

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
112112
);
113113

114114
it.effect(
115-
"refreshes cached null identities after the negative TTL when a remote is configured later",
115+
"keeps null identities cached across repeated resolves until the negative TTL expires",
116116
() =>
117117
Effect.gen(function* () {
118118
const fileSystem = yield* FileSystem.FileSystem;
@@ -128,8 +128,10 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
128128

129129
yield* git(cwd, ["remote", "add", "origin", "[email protected]:T3Tools/t3code.git"]);
130130

131-
const cachedIdentity = yield* resolver.resolve(cwd);
132-
expect(cachedIdentity).toBeNull();
131+
for (const _attempt of [1, 2, 3]) {
132+
const cachedIdentity = yield* resolver.resolve(cwd);
133+
expect(cachedIdentity).toBeNull();
134+
}
133135

134136
yield* TestClock.adjust(Duration.millis(120));
135137

‎apps/server/src/project/Layers/RepositoryIdentityResolver.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function buildRepositoryIdentity(input: {
6666

6767
const DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY = 512;
6868
const DEFAULT_POSITIVE_CACHE_TTL = Duration.minutes(1);
69-
const DEFAULT_NEGATIVE_CACHE_TTL = Duration.seconds(10);
69+
const DEFAULT_NEGATIVE_CACHE_TTL = Duration.minutes(1);
7070

7171
interface RepositoryIdentityResolverOptions {
7272
readonly cacheCapacity?: number;

0 commit comments

Comments
 (0)