Skip to content

[bug]: Batch creation max retries exceeded #1595

@jorgealemangonzalez

Description

@jorgealemangonzalez

Description

We are getting the following error when doing a batch creation 1/100 times. ¿Could it be possible that Algolia takes more that 10 seconds to create a single entry in the index?:

Error while executing operation: Error: The maximum number of retries exceeded. (10/10)
    at /workspace/node_modules/@algolia/client-common/src/createIterablePromise.ts:33:27
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Our current code:

const response = await algoliaClient.batch({
        indexName,
        batchWriteParams: {
            requests: ingredients.map(ingredient => ({
                action: 'addObject',
                body: mapIngredientToIndexable(ingredient) as unknown as Record<string, unknown>,
            })),
        },
    })

    await algoliaClient.waitForTask({
        indexName,
        taskID: response.taskID,
        maxRetries: 10,
        timeout: (retryCount: number) => 1000 * retryCount,
    })

Client

All

Version

5.38.0

Relevant log output

Error while executing operation: Error: The maximum number of retries exceeded. (10/10)
    at /workspace/node_modules/@algolia/client-common/src/createIterablePromise.ts:33:27
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions