diffpx 0.0.6 → 0.0.7
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 +5 -4
package/package.json
CHANGED
package/src/runner.js
CHANGED
|
@@ -45,7 +45,7 @@ function getProgress(status) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
async function runJob({
|
|
48
|
+
async function runJob({diffpxKey, payload}) {
|
|
49
49
|
const multiBar = new cliProgress.MultiBar({
|
|
50
50
|
clearOnComplete: false,
|
|
51
51
|
hideCursor: true,
|
|
@@ -74,14 +74,15 @@ async function runJob({ppKey, payload}) {
|
|
|
74
74
|
let jobId = null;
|
|
75
75
|
|
|
76
76
|
try {
|
|
77
|
-
const
|
|
77
|
+
const diffpxUrl = process.env.DIFFPX_URL || '';
|
|
78
|
+
const res = await submitRun(diffpxUrl, diffpxKey, payload);
|
|
78
79
|
jobId = res?.jobId || res?.id || res?.job_id || res?.data?.jobId || null;
|
|
79
80
|
if (!jobId) {
|
|
80
81
|
throw new Error('Server did not return a job id');
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
const finalStatus = await pollRun(
|
|
84
|
-
intervalMs: Number(process.env.
|
|
84
|
+
const finalStatus = await pollRun(diffpxUrl, diffpxKey, jobId, {
|
|
85
|
+
intervalMs: Number(process.env.DIFFPX_POLL_INTERVAL_MS || 1000),
|
|
85
86
|
onStatus: (status) => {
|
|
86
87
|
const p = getProgress(status);
|
|
87
88
|
|