@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ingestionClient.ts
|
|
2
2
|
import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
3
|
-
var apiClientVersion = "1.
|
|
3
|
+
var apiClientVersion = "1.53.0";
|
|
4
4
|
var REGIONS = ["eu", "us"];
|
|
5
5
|
function getDefaultHosts(region) {
|
|
6
6
|
const url = "data.{region}.algolia.com".replace("{region}", region);
|
|
@@ -97,6 +97,7 @@ function createIngestionClient({
|
|
|
97
97
|
* @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.
|
|
98
98
|
* @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.
|
|
99
99
|
* @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).
|
|
100
|
+
* @param chunkedPush.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
|
|
100
101
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
|
|
101
102
|
*/
|
|
102
103
|
async chunkedPush({
|
|
@@ -105,7 +106,8 @@ function createIngestionClient({
|
|
|
105
106
|
action = "addObject",
|
|
106
107
|
waitForTasks,
|
|
107
108
|
batchSize = 1e3,
|
|
108
|
-
referenceIndexName
|
|
109
|
+
referenceIndexName,
|
|
110
|
+
maxRetries = 100
|
|
109
111
|
}, requestOptions) {
|
|
110
112
|
let records = [];
|
|
111
113
|
let offset = 0;
|
|
@@ -141,8 +143,8 @@ function createIngestionClient({
|
|
|
141
143
|
validate: (response) => response !== void 0,
|
|
142
144
|
aggregator: () => retryCount += 1,
|
|
143
145
|
error: {
|
|
144
|
-
validate: () => retryCount >=
|
|
145
|
-
message: () => `
|
|
146
|
+
validate: () => retryCount >= maxRetries,
|
|
147
|
+
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.`
|
|
146
148
|
},
|
|
147
149
|
timeout: () => Math.min(retryCount * 1500, 5e3)
|
|
148
150
|
});
|
|
@@ -2173,11 +2175,4 @@ export {
|
|
|
2173
2175
|
isScheduleTrigger,
|
|
2174
2176
|
isSubscriptionTrigger
|
|
2175
2177
|
};
|
|
2176
|
-
//# sourceMappingURL=ingestionClient.js.mapEGIONS,
|
|
2177
|
-
apiClientVersion,
|
|
2178
|
-
createIngestionClient,
|
|
2179
|
-
isOnDemandTrigger,
|
|
2180
|
-
isScheduleTrigger,
|
|
2181
|
-
isSubscriptionTrigger
|
|
2182
|
-
};
|
|
2183
2178
|
//# sourceMappingURL=ingestionClient.js.map
|