@stemy/backend 3.1.0 → 3.1.1
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/bundles/stemy-backend.umd.js +4 -6
- package/bundles/stemy-backend.umd.js.map +1 -1
- package/bundles/stemy-backend.umd.min.js +1 -1
- package/bundles/stemy-backend.umd.min.js.map +1 -1
- package/esm2015/services/job-manager.js +4 -6
- package/fesm2015/stemy-backend.js +3 -5
- package/fesm2015/stemy-backend.js.map +1 -1
- package/package.json +1 -1
|
@@ -2493,7 +2493,7 @@
|
|
|
2493
2493
|
_a.sent();
|
|
2494
2494
|
console.log("Worker consumer connected to: " + pullHost);
|
|
2495
2495
|
this.workerPull.on("message", function (name, args, uniqueId) { return __awaiter$o(_this, void 0, void 0, function () {
|
|
2496
|
-
var jobName, jobParams, timerId,
|
|
2496
|
+
var jobName, jobParams, timerId, e_1, e_2;
|
|
2497
2497
|
return __generator(this, function (_a) {
|
|
2498
2498
|
switch (_a.label) {
|
|
2499
2499
|
case 0:
|
|
@@ -2501,10 +2501,8 @@
|
|
|
2501
2501
|
jobName = name.toString("utf8");
|
|
2502
2502
|
jobParams = JSON.parse(args.toString("utf8"));
|
|
2503
2503
|
timerId = uniqueId === null || uniqueId === void 0 ? void 0 : uniqueId.toString("utf8");
|
|
2504
|
-
jobNameLog = "\u001B[36m\"" + jobName + "\"\u001B[0m";
|
|
2505
|
-
jobArgsLog = "\n" + jsonHighlight(jobParams);
|
|
2506
2504
|
console.time(timerId);
|
|
2507
|
-
console.timeLog(timerId, "Started working on background job: " +
|
|
2505
|
+
console.timeLog(timerId, "Started working on background job: " + colorize(jobName, exports.ConsoleColor.FgCyan) + " with args: \n" + jsonHighlight(jobParams) + "\n\n");
|
|
2508
2506
|
this.messageBridge.sendMessage("job-started", { name: jobName });
|
|
2509
2507
|
_a.label = 1;
|
|
2510
2508
|
case 1:
|
|
@@ -2512,11 +2510,11 @@
|
|
|
2512
2510
|
return [4 /*yield*/, Promise.race([this.jobs[jobName](jobParams), promiseTimeout(MAX_TIMEOUT, true)])];
|
|
2513
2511
|
case 2:
|
|
2514
2512
|
_a.sent();
|
|
2515
|
-
console.timeLog(timerId, "Finished working on background job: " +
|
|
2513
|
+
console.timeLog(timerId, "Finished working on background job: " + colorize(jobName, exports.ConsoleColor.FgCyan) + "\n\n");
|
|
2516
2514
|
return [3 /*break*/, 4];
|
|
2517
2515
|
case 3:
|
|
2518
2516
|
e_1 = _a.sent();
|
|
2519
|
-
console.timeLog(timerId, "Background job failed: " +
|
|
2517
|
+
console.timeLog(timerId, "Background job failed: " + colorize(jobName, exports.ConsoleColor.FgRed) + "\n" + e_1 + "\n\n");
|
|
2520
2518
|
return [3 /*break*/, 4];
|
|
2521
2519
|
case 4:
|
|
2522
2520
|
console.timeEnd(timerId);
|