pass debug to promise-retry

This commit is contained in:
Girish Ramakrishnan
2021-12-07 11:18:26 -08:00
parent ae0e572593
commit 013f5d359d
6 changed files with 14 additions and 19 deletions

View File

@@ -17,11 +17,8 @@ async function getServerIp(config) {
if (process.env.BOX_ENV === 'test') return '127.0.0.1';
let attempt = 0;
return await promiseRetry({ times: 10, interval: 5000 }, async () => {
if (attempt) debug(`getServerIp: getting server IP. attempt ${attempt}`);
++attempt;
return await promiseRetry({ times: 10, interval: 5000, debug }, async () => {
debug('getServerIp: getting server IP');
const [networkError, response] = await safe(superagent.get('https://api.cloudron.io/api/v1/helper/public_ip')
.timeout(30 * 1000)