Skip to content

Commit

Permalink
fix: allow more than 99 PRs/branches per repository (#24705)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgreinacher committed Sep 30, 2023
1 parent f8178d7 commit 666819e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/workers/repository/process/limits.spec.ts
Expand Up @@ -46,10 +46,10 @@ describe('workers/repository/process/limits', () => {
expect(res).toBe(5);
});

it('returns 99 if no hourly limit', async () => {
it('returns MAX_SAFE_INTEGER if no hourly limit', async () => {
config.prHourlyLimit = 0;
const res = await limits.getPrHourlyRemaining(config);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});
});

Expand All @@ -74,10 +74,10 @@ describe('workers/repository/process/limits', () => {
expect(res).toBe(19);
});

it('returns 99 if no concurrent limit', async () => {
it('returns MAX_SAFE_INTEGER if no concurrent limit', async () => {
config.prConcurrentLimit = 0;
const res = await limits.getConcurrentPrsRemaining(config, []);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});
});

Expand Down Expand Up @@ -120,7 +120,7 @@ describe('workers/repository/process/limits', () => {
config.branchConcurrentLimit = 0;
config.prConcurrentLimit = 20;
const res = await limits.getConcurrentBranchesRemaining(config, []);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});

it('returns 10 if no limits are set', async () => {
Expand Down
6 changes: 3 additions & 3 deletions lib/workers/repository/process/limits.ts
Expand Up @@ -36,7 +36,7 @@ export async function getPrHourlyRemaining(
return config.prHourlyLimit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getConcurrentPrsRemaining(
Expand Down Expand Up @@ -78,7 +78,7 @@ export async function getConcurrentPrsRemaining(
return config.prConcurrentLimit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getPrsRemaining(
Expand Down Expand Up @@ -124,7 +124,7 @@ export async function getConcurrentBranchesRemaining(
return limit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getBranchesRemaining(
Expand Down

0 comments on commit 666819e

Please sign in to comment.