Skip to content
This repository was archived by the owner on Aug 21, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const { URL } = require('url');

const generateRsa = () => RSA.generateKeypairAsync(2048, 65537, {});

const pollUntilDeployed = (url, expectedContent, timeoutMs = 30 * 1000, retries = 10) => {
if (retries > 0) {
const pollUntilDeployed = (url, expectedContent, timeoutMs = 30 * 1000, attempts = 30) => {
if (attempts > 0) {
return request.get({
url: url,
simple: false // don't reject on 404
Expand All @@ -23,7 +23,7 @@ const pollUntilDeployed = (url, expectedContent, timeoutMs = 30 * 1000, retries
// GitLab CI usually takes 50-80 seconds to build
console.log(`Could not find challenge file. Retrying in ${ms(timeoutMs)}...`);
return Promise.delay(timeoutMs).then(() =>
pollUntilDeployed(url, expectedContent, timeoutMs * 2, retries - 1));
pollUntilDeployed(url, expectedContent, timeoutMs, attempts - 1));
}
});
} else {
Expand Down