@algolia/ingestion 1.52.1 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.d.ts +5 -4
- package/dist/builds/browser.js +6 -4
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +3 -3
- package/dist/builds/fetch.js +6 -4
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +6 -4
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +6 -4
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +6 -4
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +5 -4
- package/dist/node.d.cts +5 -4
- package/dist/node.d.ts +5 -4
- package/dist/src/ingestionClient.cjs +6 -4
- package/dist/src/ingestionClient.cjs.map +1 -1
- package/dist/src/ingestionClient.js +6 -11
- package/dist/src/ingestionClient.js.map +1 -1
- package/dist/worker.d.ts +5 -4
- package/package.json +9 -9
package/dist/builds/node.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createHttpRequester } from "@algolia/requester-node-http";
|
|
|
5
5
|
|
|
6
6
|
// src/ingestionClient.ts
|
|
7
7
|
import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
8
|
-
var apiClientVersion = "1.
|
|
8
|
+
var apiClientVersion = "1.53.0";
|
|
9
9
|
var REGIONS = ["eu", "us"];
|
|
10
10
|
function getDefaultHosts(region) {
|
|
11
11
|
const url = "data.{region}.algolia.com".replace("{region}", region);
|
|
@@ -102,6 +102,7 @@ function createIngestionClient({
|
|
|
102
102
|
* @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
|
|
103
103
|
* @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
104
104
|
* @param chunkedPush.referenceIndexName - This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
|
|
105
|
+
* @param chunkedPush.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
|
|
105
106
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
|
|
106
107
|
*/
|
|
107
108
|
async chunkedPush({
|
|
@@ -110,7 +111,8 @@ function createIngestionClient({
|
|
|
110
111
|
action = "addObject",
|
|
111
112
|
waitForTasks,
|
|
112
113
|
batchSize = 1e3,
|
|
113
|
-
referenceIndexName
|
|
114
|
+
referenceIndexName,
|
|
115
|
+
maxRetries = 100
|
|
114
116
|
}, requestOptions) {
|
|
115
117
|
let records = [];
|
|
116
118
|
let offset = 0;
|
|
@@ -146,8 +148,8 @@ function createIngestionClient({
|
|
|
146
148
|
validate: (response) => response !== void 0,
|
|
147
149
|
aggregator: () => retryCount += 1,
|
|
148
150
|
error: {
|
|
149
|
-
validate: () => retryCount >=
|
|
150
|
-
message: () => `
|
|
151
|
+
validate: () => retryCount >= maxRetries,
|
|
152
|
+
message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
|
|
151
153
|
},
|
|
152
154
|
timeout: () => Math.min(retryCount * 1500, 5e3)
|
|
153
155
|
});
|