[ML] File upload: Increasing timeout for upload request (#191770)

When uploading a PDF file with a semantic text field, the bulk ingest
request to elasticsearch can sometimes take longer than the default
timeout. This causes the browser to attempt the upload again, resulting
in duplicate documents.
This change increases the timeout to 1 hour which should be more than
enough time for the processor to complete given the max file sizes we
support.
This commit is contained in:
James Gowdy 2024-09-02 16:53:18 +01:00 committed by GitHub
parent 52a54f7bee
commit af9a9484de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,7 +122,10 @@ export function importDataProvider({ asCurrentUser }: IScopedClusterClient) {
bulkRequest.pipeline = pipelineId;
}
const resp = await asCurrentUser.bulk(bulkRequest, { maxRetries: 0 });
const resp = await asCurrentUser.bulk(bulkRequest, {
maxRetries: 0,
requestTimeout: 3600000,
});
if (resp.errors) {
throw resp;
} else {