mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[kbn-es] retry on all error types while setting up native realm
This commit is contained in:
parent
130ad7ca24
commit
a578261158
1 changed files with 4 additions and 2 deletions
|
@ -94,11 +94,13 @@ exports.NativeRealm = class NativeRealm {
|
|||
try {
|
||||
return await fn(attempt);
|
||||
} catch (error) {
|
||||
if (attempt >= 3 || !error.meta || error.meta.statusCode !== 401) {
|
||||
if (attempt >= 3) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
this._log.warning('[elastic] user not available yet, waiting 1.5 seconds and trying again');
|
||||
this._log.warning(
|
||||
'assuming [elastic] user not available yet, waiting 1.5 seconds and trying again'
|
||||
);
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
return await this._autoRetry(fn, attempt + 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue