omnipin 1.6.1 → 1.6.2
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/dist/cli.js +11 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,8 +6,11 @@ import { styleText } from "node:util";
|
|
|
6
6
|
import * as nc from "node:crypto";
|
|
7
7
|
import { createHash, createHmac } from "node:crypto";
|
|
8
8
|
import { randomInt as randomInt2 } from "node:crypto";
|
|
9
|
+
import { setTimeout as setTimeout4 } from "node:timers/promises";
|
|
9
10
|
import crypto3 from "node:crypto";
|
|
10
11
|
import { randomInt } from "node:crypto";
|
|
12
|
+
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
13
|
+
import { setTimeout as setTimeout3 } from "node:timers/promises";
|
|
11
14
|
import * as nodeCrypto from "crypto";
|
|
12
15
|
import crypto5 from "crypto";
|
|
13
16
|
import fs from "fs";
|
|
@@ -28,6 +31,7 @@ import { tmpdir } from "node:os";
|
|
|
28
31
|
import { styleText as styleText2 } from "node:util";
|
|
29
32
|
import path2 from "node:path";
|
|
30
33
|
import { styleText as styleText3 } from "node:util";
|
|
34
|
+
import { setTimeout as setTimeout5 } from "node:timers/promises";
|
|
31
35
|
import { styleText as styleText5 } from "node:util";
|
|
32
36
|
import { styleText as styleText6 } from "node:util";
|
|
33
37
|
import { writeFile } from "node:fs/promises";
|
|
@@ -14431,7 +14435,7 @@ var waitForTransaction = async (provider, hash2) => {
|
|
|
14431
14435
|
return fromRpc3({ ...rawReceipt, chainId });
|
|
14432
14436
|
}
|
|
14433
14437
|
const delay = Math.min(1e3 * 2 ** attempt, 3e4);
|
|
14434
|
-
await
|
|
14438
|
+
await setTimeout2(delay);
|
|
14435
14439
|
}
|
|
14436
14440
|
throw new Error(`Transaction ${hash2} not mined within timeout period`);
|
|
14437
14441
|
};
|
|
@@ -15319,7 +15323,7 @@ var waitForDatasetReady = async (statusUrl) => {
|
|
|
15319
15323
|
${await res.text()}`);
|
|
15320
15324
|
}
|
|
15321
15325
|
if (!json.dataSetCreated) {
|
|
15322
|
-
await
|
|
15326
|
+
await setTimeout3(3e3);
|
|
15323
15327
|
continue;
|
|
15324
15328
|
}
|
|
15325
15329
|
if (json.txStatus === "confirmed" && json.dataSetCreated) {
|
|
@@ -15393,6 +15397,8 @@ var uploadToFilecoin = async ({
|
|
|
15393
15397
|
await waitForTransaction(filProvider[chainId], hash3);
|
|
15394
15398
|
await waitForDatasetReady(statusUrl2);
|
|
15395
15399
|
logger.success("Data set registered");
|
|
15400
|
+
logger.info("Waiting for 5 seconds to ensure everything is in sync");
|
|
15401
|
+
await setTimeout4(5e3);
|
|
15396
15402
|
} else {
|
|
15397
15403
|
logger.info(`Using existing dataset: ${providerDataSets[0].dataSetId}`);
|
|
15398
15404
|
datasetId = providerDataSets[0].dataSetId;
|
|
@@ -15452,7 +15458,7 @@ var uploadToFilecoin = async ({
|
|
|
15452
15458
|
if (res.ok) {
|
|
15453
15459
|
break;
|
|
15454
15460
|
}
|
|
15455
|
-
await
|
|
15461
|
+
await setTimeout4(1e3);
|
|
15456
15462
|
}
|
|
15457
15463
|
logger.success("Piece found");
|
|
15458
15464
|
const { hash: hash2, statusUrl } = await uploadPieceToDataSet({
|
|
@@ -30150,7 +30156,7 @@ var pingAction = async ({
|
|
|
30150
30156
|
if (response.status === 504) {
|
|
30151
30157
|
if (attempt < maxRetries) {
|
|
30152
30158
|
logger.text(`\u{1F504} Retrying in ${retryInterval / 1e3} seconds...`);
|
|
30153
|
-
await
|
|
30159
|
+
await setTimeout5(retryInterval);
|
|
30154
30160
|
} else {
|
|
30155
30161
|
return logger.error(gwOfflineMessage);
|
|
30156
30162
|
}
|
|
@@ -30160,7 +30166,7 @@ var pingAction = async ({
|
|
|
30160
30166
|
} catch (error3) {
|
|
30161
30167
|
if (error3 instanceof DOMException && attempt < maxRetries) {
|
|
30162
30168
|
logger.info(`\u231B Timed out. Retrying...`);
|
|
30163
|
-
await
|
|
30169
|
+
await setTimeout5(retryInterval);
|
|
30164
30170
|
} else {
|
|
30165
30171
|
logger.error(error3 instanceof DOMException ? gwOfflineMessage : `Error fetching endpoint: ${error3.message}`);
|
|
30166
30172
|
throw error3;
|