typo
This commit is contained in:
@@ -31,8 +31,8 @@ function runTask(appId, taskName, callback) {
|
||||
|
||||
if (app.installationState !== apps.ISTATE_INSTALLED || app.runState !== apps.RSTATE_RUNNING || app.health !== apps.HEALTH_HEALTHY) return callback();
|
||||
|
||||
docker.inspectByName(containerName, function (err, data) {
|
||||
if (!err && data && data.State.Running === true) {
|
||||
docker.inspectByName(containerName, function (error, data) {
|
||||
if (!error && data && data.State.Running === true) {
|
||||
const jobStartTime = new Date(data.State.StartedAt); // iso 8601
|
||||
if (new Date() - jobStartTime < JOB_MAX_TIME) return callback();
|
||||
}
|
||||
@@ -59,8 +59,7 @@ function createCronJobs(app, schedulerConfig, callback) {
|
||||
const cmd = schedulerConfig[taskName].command;
|
||||
|
||||
docker.createSubcontainer(app, containerName, [ '/bin/sh', '-c', cmd ], { } /* options */, function (error) {
|
||||
if (error && error.reason === BoxError.ALREADY_EXISTS) return iteratorDone();
|
||||
if (error) return iteratorDone(error);
|
||||
if (error && error.reason !== BoxError.ALREADY_EXISTS) return iteratorDone(error);
|
||||
|
||||
var cronJob = new CronJob({
|
||||
cronTime: cronTime, // at this point, the pattern has been validated
|
||||
|
||||
Reference in New Issue
Block a user