Skip to content

Commit

Permalink
[ci-stats] retry calls to ci-stats slower (#110845) (#110878)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <[email protected]>

Co-authored-by: Spencer <[email protected]>
Co-authored-by: spalger <[email protected]>
  • Loading branch information
3 people authored Sep 1, 2021
1 parent 4d8cc22 commit 51801e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ export class CiStatsReporter {
? `${error.response.status} response`
: 'no response';

const seconds = attempt * 10;
this.log.warning(
`failed to reach ci-stats service [reason=${reason}], retrying in ${attempt} seconds`
`failed to reach ci-stats service, retrying in ${seconds} seconds, [reason=${reason}], [error=${error.message}]`
);

await new Promise((resolve) => setTimeout(resolve, attempt * 1000));
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59522,8 +59522,9 @@ class CiStatsReporter {


const reason = error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && _error$response.status ? `${error.response.status} response` : 'no response';
this.log.warning(`failed to reach ci-stats service [reason=${reason}], retrying in ${attempt} seconds`);
await new Promise(resolve => setTimeout(resolve, attempt * 1000));
const seconds = attempt * 10;
this.log.warning(`failed to reach ci-stats service, retrying in ${seconds} seconds, [reason=${reason}], [error=${error.message}]`);
await new Promise(resolve => setTimeout(resolve, seconds * 1000));
}
}
}
Expand Down

0 comments on commit 51801e7

Please sign in to comment.