Skip to content

Commit

Permalink
waitForIndexStatusYellow: Don't reject on 408 status from health api (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf authored Nov 22, 2021
1 parent bd63968 commit 9bc13b3
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ export const waitForIndexStatusYellow =
}: WaitForIndexStatusYellowParams): TaskEither.TaskEither<RetryableEsClientError, {}> =>
() => {
return client.cluster
.health({
index,
wait_for_status: 'yellow',
timeout,
// @ts-expect-error
return_200_for_cluster_health_timeout: true, // opt-in to the 8.0 breaking behaviour to prevent a deprecation log
})
.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 9bc13b3

Please sign in to comment.