@openinc/parse-server-opendash 2.4.72 → 2.4.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/hooks/MES_Order.js +21 -3
- package/package.json +1 -1
package/dist/hooks/MES_Order.js
CHANGED
|
@@ -296,12 +296,30 @@ function scheduleOrderStartedStatusCheck(cronInterval) {
|
|
|
296
296
|
query.find({ useMasterKey: true }).then((orders) => {
|
|
297
297
|
orders.forEach((order) => {
|
|
298
298
|
const status = order.get("status");
|
|
299
|
-
if (status
|
|
300
|
-
if (order.get("
|
|
301
|
-
order.
|
|
299
|
+
if (!status) {
|
|
300
|
+
if (order.get("tag")) {
|
|
301
|
+
if (order.get("start").getTime() < Date.now()) {
|
|
302
|
+
order.set("status", "running");
|
|
303
|
+
order.save(null, { useMasterKey: true });
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
order.set("status", "planned");
|
|
307
|
+
order.save(null, { useMasterKey: true });
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
order.set("status", "unknown");
|
|
302
312
|
order.save(null, { useMasterKey: true });
|
|
303
313
|
}
|
|
304
314
|
}
|
|
315
|
+
else {
|
|
316
|
+
if (status === "unknown" || status === "planned") {
|
|
317
|
+
if (order.get("start").getTime() < Date.now()) {
|
|
318
|
+
order.set("status", "running");
|
|
319
|
+
order.save(null, { useMasterKey: true });
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
305
323
|
});
|
|
306
324
|
});
|
|
307
325
|
}, // onTick
|