@merkl/api 0.10.415 → 0.10.416
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.
@@ -36,7 +36,7 @@ const extract = async () => {
|
|
36
36
|
}
|
37
37
|
if (data.length < MAX_BATCH_SIZE)
|
38
38
|
continue;
|
39
|
-
loadPromises.push(withRetry(load, [data], 5,
|
39
|
+
loadPromises.push(withRetry(load, [data], 5, 10_000));
|
40
40
|
data = [];
|
41
41
|
}
|
42
42
|
// Final batch
|
@@ -50,7 +50,7 @@ const extract = async () => {
|
|
50
50
|
else
|
51
51
|
count += x.value;
|
52
52
|
}
|
53
|
-
return { count, failed };
|
53
|
+
return { count, failed, batch: promiseResults.length };
|
54
54
|
};
|
55
55
|
// ─── Transform & Load ────────────────────────────────────────────────────────
|
56
56
|
const load = async (pendings) => {
|
@@ -191,8 +191,8 @@ export const main = async () => {
|
|
191
191
|
log.info(`✅ Running for ${process.env.FILENAME}`);
|
192
192
|
const start = moment().unix();
|
193
193
|
// ─── Start Rewards ETL ───────────────────────────────────────────────
|
194
|
-
const { count, failed } = await extract();
|
195
|
-
log.info(`✅ Successfully created ${count} new records for ${process.env.FILENAME} in ${moment().unix() - start} sec`);
|
194
|
+
const { count, failed, batch } = await extract();
|
195
|
+
log.info(`✅ Successfully created ${count} new records in ${batch} batches for ${process.env.FILENAME} in ${moment().unix() - start} sec`);
|
196
196
|
if (failed !== 0) {
|
197
197
|
log.error("pendings", `${failed} batches failed.`);
|
198
198
|
process.exit(1);
|