more debug() removal
This commit is contained in:
@@ -23,8 +23,6 @@ function sync(callback) {
|
||||
|
||||
callback = callback || NOOP_CALLBACK;
|
||||
|
||||
debug('sync: synchronizing global state with installed app state');
|
||||
|
||||
apps.getAll(function (error, allApps) {
|
||||
if (error) return callback(error);
|
||||
|
||||
@@ -67,8 +65,6 @@ function sync(callback) {
|
||||
iteratorDone();
|
||||
});
|
||||
});
|
||||
|
||||
debug('sync: done');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -92,8 +88,6 @@ function stopJobs(appId, appState, callback) {
|
||||
assert.strictEqual(typeof appState, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug(`stopJobs: stopping jobs of ${appId}`);
|
||||
|
||||
if (!appState) return callback();
|
||||
|
||||
async.eachSeries(Object.keys(appState.schedulerConfig), function (taskName, iteratorDone) {
|
||||
@@ -109,8 +103,6 @@ function createCronJobs(app, schedulerConfig) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert(schedulerConfig && typeof schedulerConfig === 'object');
|
||||
|
||||
debug(`createCronJobs: creating cron jobs for app ${app.fqdn}`);
|
||||
|
||||
var jobs = { };
|
||||
|
||||
Object.keys(schedulerConfig).forEach(function (taskName) {
|
||||
@@ -120,8 +112,6 @@ function createCronJobs(app, schedulerConfig) {
|
||||
|
||||
var cronTime = (constants.TEST ? '*/5 ' : `${randomSecond} `) + task.schedule; // time ticks faster in tests
|
||||
|
||||
debug(`createCronJobs: ${app.fqdn} task ${taskName} scheduled at ${cronTime} with cmd ${task.command}`);
|
||||
|
||||
var cronJob = new CronJob({
|
||||
cronTime: cronTime, // at this point, the pattern has been validated
|
||||
onTick: runTask.bind(null, app.id, taskName), // put the app id in closure, so we don't use the outdated app object by mistake
|
||||
@@ -156,10 +146,7 @@ function runTask(appId, taskName, callback) {
|
||||
docker.inspectByName(containerName, function (err, data) {
|
||||
if (!err && data && data.State.Running === true) {
|
||||
const jobStartTime = new Date(data.State.StartedAt); // iso 8601
|
||||
if (new Date() - jobStartTime < JOB_MAX_TIME) {
|
||||
debug(`runTask: skipped task ${taskName} of app ${app.fqdn} since it was started at ${jobStartTime}`);
|
||||
return callback();
|
||||
}
|
||||
if (new Date() - jobStartTime < JOB_MAX_TIME) return callback();
|
||||
}
|
||||
|
||||
killContainer(containerName, function (error) {
|
||||
|
||||
Reference in New Issue
Block a user