From 81c49cf1191f325dac2730d1ee262c8b30cb4753 Mon Sep 17 00:00:00 2001 From: miketwc1984 Date: Fri, 27 Oct 2023 12:19:20 -0400 Subject: [PATCH] sync to 0.9.38 --- lib/job.js | 2 +- lib/scheduler.js | 12 +++++++++++- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/job.js b/lib/job.js index f19740b..d968d16 100644 --- a/lib/job.js +++ b/lib/job.js @@ -790,7 +790,7 @@ module.exports = Class.create({ } // only pull in properties we recognize - ['progress', 'memo', 'complete', 'code', 'description', 'perf', 'update_event', 'table', 'html', 'chain', 'chain_data', 'chain_error', 'notify_success', 'notify_fail'].forEach(function (key) { + ['progress', 'memo', 'complete', 'code', 'description', 'perf', 'update_event', 'table', 'html', 'chain', 'chain_data', 'chain_params', 'chain_error', 'notify_success', 'notify_fail'].forEach(function (key) { if (key in data) job[key] = data[key]; }); diff --git a/lib/scheduler.js b/lib/scheduler.js index 2e9c3da..0abf7af 100644 --- a/lib/scheduler.js +++ b/lib/scheduler.js @@ -70,6 +70,11 @@ module.exports = Class.create({ }); // loaded state }, + safeJobLog(job) { // print less verbose, more readable job data on logging + if(!job) return '' + return Object.keys(job).filter(e => ! ["table", "secret", "env"].includes(e)).map(e => e + ': ' + ("params|workflow|perf".indexOf(e) > -1 ? JSON.stringify(job[e]) : job[e]) ).join(" | ") + }, + schedulerMinuteTick: function (dargs, catch_up_only) { // a new minute has started, see if jobs need to run var self = this; @@ -338,7 +343,12 @@ module.exports = Class.create({ source_event: old_job.event }); - self.logDebug(6, "Running event via chain reaction: " + job.title, job); + + // merge in chain_params if applicable + if (!job.params) job.params = {}; + if (old_job.chain_params) Tools.mergeHashInto(job.params, old_job.chain_params); + + self.logDebug(6, "Running event via chain reaction: " + job.title, self.safeJobLog(job)); self.launchOrQueueJob(job, function (err, jobs_launched) { if (err) { diff --git a/package-lock.json b/package-lock.json index 99a48aa..1ecb285 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cronicle-edge", - "version": "1.7.4", + "version": "1.7.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cronicle-edge", - "version": "1.7.4", + "version": "1.7.5", "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5", diff --git a/package.json b/package.json index 528067f..bd57a6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cronicle-edge", - "version": "1.7.4", + "version": "1.7.5", "description": "A simple, distributed task scheduler and runner with a web based UI.", "author": "Joseph Huckaby ", "homepage": "https://github.com/jhuckaby/Cronicle",