diffpx 0.0.8 → 0.0.9
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/package.json +1 -1
- package/src/runner.js +6 -15
package/package.json
CHANGED
package/src/runner.js
CHANGED
|
@@ -51,8 +51,7 @@ async function runJob({diffpxKey, payload}) {
|
|
|
51
51
|
hideCursor: true,
|
|
52
52
|
barCompleteChar: '█',
|
|
53
53
|
barIncompleteChar: '░',
|
|
54
|
-
format: '{name} [{bar}] {percentage}% | {value}/{total}'
|
|
55
|
-
stream: process.stdout
|
|
54
|
+
format: '{name} [{bar}] {percentage}% | {value}/{total}'
|
|
56
55
|
}, cliProgress.Presets.shades_classic);
|
|
57
56
|
|
|
58
57
|
const initialSnapshotsTotal = Array.isArray(payload?.snapshots) ? payload.snapshots.length : 1;
|
|
@@ -71,8 +70,6 @@ async function runJob({diffpxKey, payload}) {
|
|
|
71
70
|
);
|
|
72
71
|
|
|
73
72
|
let jobId = null;
|
|
74
|
-
let lastSnapshot = {total: Math.max(1, initialSnapshotsTotal), done: 0, label: getInitialSnapshotName(payload)};
|
|
75
|
-
let lastWidth = {total: Math.max(1, initialWidthsTotal), done: 0, label: getInitialWidthName(payload)};
|
|
76
73
|
|
|
77
74
|
try {
|
|
78
75
|
const diffpxUrl = process.env.DIFFPX_URL || '';
|
|
@@ -83,7 +80,7 @@ async function runJob({diffpxKey, payload}) {
|
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
const finalStatus = await pollRun(diffpxUrl, diffpxKey, jobId, {
|
|
86
|
-
intervalMs:
|
|
83
|
+
intervalMs: 1000,
|
|
87
84
|
onStatus: (status) => {
|
|
88
85
|
const p = getProgress(status);
|
|
89
86
|
|
|
@@ -93,20 +90,14 @@ async function runJob({diffpxKey, payload}) {
|
|
|
93
90
|
const snapTotal = p.snapshotsTotal > 0 ? p.snapshotsTotal : Math.max(1, initialSnapshotsTotal);
|
|
94
91
|
const snapDone = p.snapshotsTotal > 0 ? Math.min(p.snapshotsDone, p.snapshotsTotal) : snapshotsBar.value;
|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
snapshotsBar.update(snapDone, {name: snapshotLabel});
|
|
99
|
-
lastSnapshot = {total: snapTotal, done: snapDone, label: snapshotLabel};
|
|
100
|
-
}
|
|
93
|
+
snapshotsBar.setTotal(snapTotal);
|
|
94
|
+
snapshotsBar.update(snapDone, {name: snapshotLabel});
|
|
101
95
|
|
|
102
96
|
const wTotal = p.widthsTotal > 0 ? p.widthsTotal : Math.max(1, initialWidthsTotal);
|
|
103
97
|
const wDone = p.widthsTotal > 0 ? Math.min(p.widthsDone, p.widthsTotal) : widthsBar.value;
|
|
104
98
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
widthsBar.update(wDone, {name: widthLabel});
|
|
108
|
-
lastWidth = {total: wTotal, done: wDone, label: widthLabel};
|
|
109
|
-
}
|
|
99
|
+
widthsBar.setTotal(wTotal);
|
|
100
|
+
widthsBar.update(wDone, {name: widthLabel});
|
|
110
101
|
}
|
|
111
102
|
});
|
|
112
103
|
|