Skip to content

Commit

Permalink
waitForIndexStatusYellow: Don't reject on 408 status from health api (e…
Browse files Browse the repository at this point in the history
…lastic#119136) (elastic#119159)

Co-authored-by: Rudolf Meijering <rudolf.meijering@elastic.co>
  • Loading branch information
kibanamachine and rudolf authored Nov 19, 2021
1 parent 43fb6d3 commit 0a3cce7
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ export const waitForIndexStatusYellow =
}: WaitForIndexStatusYellowParams): TaskEither.TaskEither<RetryableEsClientError, {}> =>
() => {
return client.cluster
.health({
index,
wait_for_status: 'yellow',
timeout,
})
.health(
{
index,
wait_for_status: 'yellow',
timeout,
},
// Don't reject on status code 408 so that we can handle the timeout
// explicitly and provide more context in the error message
{ ignore: [408] }
)
.then((res) => {
if (res.body.timed_out === true) {
return Either.left({
Expand Down

0 comments on commit 0a3cce7

Please sign in to comment.