diff --git a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html index 66c49b3b8..fbd8ef8f6 100644 --- a/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html +++ b/client/cat3/src/partials/sections/dashboard/workzone/orchestration/popups/addChefJobEvent.html @@ -68,7 +68,7 @@
Script Details
diff --git a/server/app/cronjobs/catalyst-scheduler/catalystScheduler.js b/server/app/cronjobs/catalyst-scheduler/catalystScheduler.js index bedbc9be7..552bdaf7a 100644 --- a/server/app/cronjobs/catalyst-scheduler/catalystScheduler.js +++ b/server/app/cronjobs/catalyst-scheduler/catalystScheduler.js @@ -7,12 +7,14 @@ var cronTab = require('node-crontab'); var catalystSync = module.exports = {}; catalystSync.executeScheduledInstances = function executeScheduledInstances() { + logger.debug("Instance Scheduler is started. "); instancesDao.getScheduledInstances(function(err, instances) { if (err) { logger.error("Failed to fetch Instance: ", err); return; } if (instances && instances.length) { + logger.debug("Schedule Instance length>>"+instances.length); var resultList =[]; for (var i = 0; i < instances.length; i++) { (function(instance) { @@ -21,6 +23,7 @@ catalystSync.executeScheduledInstances = function executeScheduledInstances() { } resultList.push(function(callback){schedulerService.executeSchedulerForInstances(instance,callback);}); if(resultList.length === instances.length){ + logger.debug("Schedule Instance length for Scheduler Start>>"+resultList.length); async.parallel(resultList,function(err,results){ if(err){ logger.error(err); diff --git a/server/app/model/classes/tasks/taskHistory.js b/server/app/model/classes/tasks/taskHistory.js index 715b05158..c78748847 100755 --- a/server/app/model/classes/tasks/taskHistory.js +++ b/server/app/model/classes/tasks/taskHistory.js @@ -56,7 +56,11 @@ var taskHistorySchema = new Schema({ bgName: String, projectName: String, envName: String, - taskName: String + taskName: String, + manualExecutionTime: { + type: Number, + required: false + } }); taskHistorySchema.plugin(mongoosePaginate); diff --git a/server/app/model/classes/tasks/tasks.js b/server/app/model/classes/tasks/tasks.js index 0e7c6329d..17d65b945 100755 --- a/server/app/model/classes/tasks/tasks.js +++ b/server/app/model/classes/tasks/tasks.js @@ -205,8 +205,7 @@ var taskSchema = new Schema({ }, manualExecutionTime:{ type: Number, - required: false, - default:10 + required: false } }); taskSchema.plugin(mongoosePaginate); @@ -227,9 +226,9 @@ taskSchema.methods.execute = function(userName, baseUrl, choiceParam, appData, b orgName: self.orgName, bgName: self.bgName, projectName: self.projectName, - envName: self.envName + envName: self.envName, + manualExecutionTime:self.manualExecutionTime }; - if (this.taskType === TASK_TYPE.CHEF_TASK) { task = new ChefTask(this.taskConfig); diff --git a/server/app/routes/v1.0/routes_organizations.js b/server/app/routes/v1.0/routes_organizations.js index 3c458a04f..ab1879030 100755 --- a/server/app/routes/v1.0/routes_organizations.js +++ b/server/app/routes/v1.0/routes_organizations.js @@ -987,6 +987,11 @@ module.exports.setRoutes = function(app, sessionVerification) { if(taskData.taskType === 'jenkins'){ taskData.executionOrder= 'PARALLEL'; } + if(taskData.manualExecutionTime && taskData.manualExecutionTime !== null){ + taskData.manualExecutionTime = parseInt(taskData.manualExecutionTime); + }else{ + taskData.manualExecutionTime = 10; + } configmgmtDao.getEnvNameFromEnvId(req.params.envId, function(err, envName) { if (err) { res.status(500).send("Failed to fetch ENV: ", err); diff --git a/server/app/routes/v1.0/routes_tasks.js b/server/app/routes/v1.0/routes_tasks.js index 34298868b..b8b48a41e 100755 --- a/server/app/routes/v1.0/routes_tasks.js +++ b/server/app/routes/v1.0/routes_tasks.js @@ -521,6 +521,11 @@ module.exports.setRoutes = function(app, sessionVerification) { taskData.taskScheduler = apiUtil.createCronJobPattern(taskData.taskScheduler); taskData.isTaskScheduled = true; } + if(taskData.manualExecutionTime && taskData.manualExecutionTime !== null){ + taskData.manualExecutionTime = parseInt(taskData.manualExecutionTime); + }else{ + taskData.manualExecutionTime = 10; + } if (taskData.taskType === 'script') { Tasks.getTaskById(req.params.taskId, function(err, scriptTask) { if (err) {