fix(server): extend negative repository identity cache ttl (#2083)
This commit is contained in:
1 parent
e0117b271a
commit
d90e15d1d7
2 files changed
+6
-4
No files matched your search
@@ -140,7 +140,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
|
||||
);
|
||||
|
||||
it.effect(
|
||||
"refreshes cached null identities after the negative TTL when a remote is configured later",
|
||||
"keeps null identities cached across repeated resolves until the negative TTL expires",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
@@ -156,8 +156,10 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
|
||||
|
||||
yield* git(cwd, ["remote", "add", "origin", "[email protected]:T3Tools/t3code.git"]);
|
||||
|
||||
const cachedIdentity = yield* resolver.resolve(cwd);
|
||||
expect(cachedIdentity).toBeNull();
|
||||
for (const _attempt of [1, 2, 3]) {
|
||||
const cachedIdentity = yield* resolver.resolve(cwd);
|
||||
expect(cachedIdentity).toBeNull();
|
||||
}
|
||||
|
||||
yield* TestClock.adjust(Duration.millis(120));
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ function buildRepositoryIdentity(input: {
|
||||
|
||||
const DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY = 512;
|
||||
const DEFAULT_POSITIVE_CACHE_TTL = Duration.minutes(1);
|
||||
const DEFAULT_NEGATIVE_CACHE_TTL = Duration.seconds(10);
|
||||
const DEFAULT_NEGATIVE_CACHE_TTL = Duration.minutes(1);
|
||||
|
||||
interface RepositoryIdentityResolverOptions {
|
||||
readonly cacheCapacity?: number;
|
||||
|
||||
Reference in new issue
Block a user