repowise 0.1.72 → 0.1.73
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/bin/repowise.js +13 -1
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -2435,6 +2435,8 @@ async function create() {
|
|
|
2435
2435
|
spinner.start();
|
|
2436
2436
|
}
|
|
2437
2437
|
let pollAttempts = 0;
|
|
2438
|
+
let pollErrors = 0;
|
|
2439
|
+
const MAX_POLL_ERRORS = 5;
|
|
2438
2440
|
const progressRenderer = new ProgressRenderer();
|
|
2439
2441
|
while (true) {
|
|
2440
2442
|
if (++pollAttempts > MAX_POLL_ATTEMPTS) {
|
|
@@ -2443,7 +2445,17 @@ async function create() {
|
|
|
2443
2445
|
return;
|
|
2444
2446
|
}
|
|
2445
2447
|
await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
|
|
2446
|
-
|
|
2448
|
+
let syncResult;
|
|
2449
|
+
try {
|
|
2450
|
+
syncResult = await apiRequest(`/v1/sync/${syncId}/status`);
|
|
2451
|
+
pollErrors = 0;
|
|
2452
|
+
} catch (pollErr) {
|
|
2453
|
+
pollErrors++;
|
|
2454
|
+
if (pollErrors >= MAX_POLL_ERRORS) {
|
|
2455
|
+
throw pollErr;
|
|
2456
|
+
}
|
|
2457
|
+
continue;
|
|
2458
|
+
}
|
|
2447
2459
|
progressRenderer.update(syncResult, spinner);
|
|
2448
2460
|
if (syncResult.status === "awaiting_input" && syncResult.questionId && syncResult.questionText) {
|
|
2449
2461
|
spinner.stop();
|