Elasticsearch requires string timeouts

This commit is contained in:
Rudolf Meijering 2022-07-19 16:18:59 +02:00
parent 91df1788ce
commit f774474a30
5 changed files with 7 additions and 7 deletions

View file

@ -75,13 +75,13 @@ export const cloneIndex = ({
// Set an explicit refresh interval so that we don't inherit the
// value from incorrectly configured index templates (not required
// after we adopt system indices)
refresh_interval: '1000',
refresh_interval: '1s',
// Bump priority so that recovery happens before newer indices
priority: 10,
},
},
},
timeout,
timeout: `${timeout}ms`,
},
{ maxRetries: 0 /** handle retry ourselves for now */ }
)

View file

@ -77,9 +77,9 @@ export const createIndex = ({
// wait up to timeout until the following shards are available before
// creating the index: primary, replica (only on multi node clusters)
wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE,
// Wait up to 60s for the cluster state to update and all shards to be
// Wait up to 50s for the cluster state to update and all shards to be
// available
timeout: DEFAULT_TIMEOUT,
timeout: `${DEFAULT_TIMEOUT}ms`,
body: {
mappings,
aliases: aliasesObject,

View file

@ -49,7 +49,7 @@ export const updateAndPickupMappings = ({
.putMapping(
{
index,
timeout: DEFAULT_TIMEOUT,
timeout: `${DEFAULT_TIMEOUT}ms`,
body: mappings,
},
{

View file

@ -79,7 +79,7 @@ export function waitForIndexStatus({
{
index,
wait_for_status: status,
timeout,
timeout: `${timeout}ms`,
},
{
// Don't reject on status code 408 so that we can handle the timeout

View file

@ -80,7 +80,7 @@ export const waitForTask =
.get({
task_id: taskId,
wait_for_completion: true,
timeout,
timeout: `${timeout}ms`,
})
.then((body) => {
const failures = body.response?.failures ?? [];