Skip to content
Snippets Groups Projects
Commit 101226db authored by Țurcanu Dragomir's avatar Țurcanu Dragomir Committed by Rhys Arkins
Browse files

fix: add 5s sleep after automerge or restart (#1761)

This hopefully gives a better chance of GitHub being able to finish computing the new mergeability status, and reduces the chance of a race condition.

Closes #1617
parent ced374ea
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ const { writeUpdates } = require('./write');
const { handleError } = require('./error');
const { pruneStaleBranches } = require('./cleanup');
const { validatePrs } = require('./validate');
const delay = require('delay');
const { resolvePackageFiles } = require('../../manager');
......@@ -81,6 +82,7 @@ async function renovateRepository(repoConfig, token, loop = 1) {
: await ensureOnboardingPr(config);
if (res === 'pr-closed' || res === 'automerged') {
logger.info(`Restarting repo renovation after ${res}`);
await delay(5000);
return renovateRepository(repoConfig, token, loop + 1);
}
await validatePrs(commonConfig || config);
......
......@@ -14,6 +14,7 @@ jest.mock('../../../lib/workers/repository/write');
jest.mock('../../../lib/workers/repository/cleanup');
jest.mock('../../../lib/workers/repository/validate');
jest.mock('../../../lib/manager');
jest.mock('delay');
let config;
beforeEach(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment