Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Nov 20, 2024
1 parent 5214254 commit 0071de2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export interface RenovateConfig
packageFile?: string;
packageRules?: PackageRule[];
postUpdateOptions?: string[];
branchConcurrentLimit?: number;
branchConcurrentLimit?: number | null;
prConcurrentLimit?: number;
prHourlyLimit?: number;
forkModeDisallowMaintainerEdits?: boolean;
Expand Down
14 changes: 7 additions & 7 deletions lib/workers/global/limits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('workers/global/limits', () => {
const upgrades = partial<BranchUpgradeConfig>([
{
prHourlyLimit: 10,
branchConcurrentLimit: null as never,
branchConcurrentLimit: null,
prConcurrentLimit: 12,
},
]);
Expand Down Expand Up @@ -145,8 +145,8 @@ describe('workers/global/limits', () => {
},
{
prHourlyLimit: 5,
branchConcurrentLimit: null as never,
prConcurrentLimit: undefined as never,
branchConcurrentLimit: null,
prConcurrentLimit: undefined,
},
{
prHourlyLimit: 5,
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('workers/global/limits', () => {
},
{
prHourlyLimit: 0,
branchConcurrentLimit: null as never,
branchConcurrentLimit: null,
prConcurrentLimit: 3,
},
]);
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('workers/global/limits', () => {
},
{
prHourlyLimit: 0,
branchConcurrentLimit: null as never,
branchConcurrentLimit: null,
prConcurrentLimit: 3,
},
]);
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('workers/global/limits', () => {
},
{
prHourlyLimit: 2,
branchConcurrentLimit: null as never,
branchConcurrentLimit: null,
prConcurrentLimit: 3,
},
]);
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('workers/global/limits', () => {
},
{
prHourlyLimit: 5,
branchConcurrentLimit: null as never,
branchConcurrentLimit: null,
prConcurrentLimit: 3,
},
]);
Expand Down
5 changes: 3 additions & 2 deletions lib/workers/global/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ export function calcLimit(
`${limitName} of the upgrades present in this branch`,
);

let lowestLimit = Number.MAX_SAFE_INTEGER;
if (hasMultipleLimits(upgrades, limitName)) {
logger.warn(
logger.once.debug(
`Branch has multiple ${limitName} limits. The lowest among these will be selected.`,
);
}

let lowestLimit = Number.MAX_SAFE_INTEGER;
for (const upgrade of upgrades) {
let limit = upgrade[limitName];

Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/process/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function getPrHourlyCount(
): Promise<number> {
try {
const prList = await platform.getPrList();
const currentHourStart = DateTime.local().startOf('hour');
const currentHourStart = DateTime.local().setZone('utc').startOf('hour');
logger.debug(
`Calculating PRs created so far in this hour currentHourStart=${String(currentHourStart)}`,
);
Expand Down

0 comments on commit 0071de2

Please sign in to comment.