Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Task</
<option value="" selected="selected">Choose Start Hour</option>
<option ng-repeat="timeNumber in repeatCount(23)" value="{{timeNumber}}" title="Time Starts {{timeNumber}} {{repeatsType}}">{{timeNumber}}</option>
</select>-->
<select name="timeEventHour" class="form-control-date" ng-model="timeEventHour" required>
<select name="timeEventHour" class="form-control-date" ng-model="timeEventHour">
<option value="" selected="selected">Choose the Hour</option>
<option ng-repeat="timeEventHour in repeatHourCount(23)" value="{{timeEventHour}}" title="Repeat Every {{timeEventHour}}">{{timeEventHour}}</option>
</select>
Expand All @@ -83,7 +83,7 @@ <h4 class="modal-title"><i class="fa fa-calendar"></i>&nbsp;Schedule your Task</
<option value="" selected="selected">Choose Start Minute</option>
<option ng-repeat="timeNumberMinutes in repeatCount(59)" value="{{timeNumberMinutes}}" title="Time Starts {{timeNumberMinutes}} {{repeatsType}}">{{timeNumberMinutes}}</option>
</select>-->
<select name="timeEventMinute" class="form-control-date" ng-model="timeEventMinute" required>
<select name="timeEventMinute" class="form-control-date" ng-model="timeEventMinute">
<option value="" selected="selected">Choose the Minute</option>
<option ng-repeat="timeEventMinute in repeatHourCount(59)" value="{{timeEventMinute}}" title="Repeat Every {{timeEventMinute}}">{{timeEventMinute}}</option>
</select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ <h5>Script Details</h5>
<label for="scripts" class="lable-align">Script List</label>
</div>
<label ng-show="scriptSelectAll" class="checkbox check-list checkboxStyling">
Select All : &nbsp;<input type="checkbox" class="checkbox-list checkboxall-right" ng-click="toggleAllScripts()" ng-model="$parent.isAllScriptSelected" title="Select All ">
Select All : &nbsp;<input type="checkbox" ng-checked="false" class="checkbox-list checkboxall-right" ng-click="toggleAllScripts()" ng-model="$parent.isAllScriptSelected" title="Select All ">
</label>
</div>
<div class="select-nodes">
Expand Down
3 changes: 3 additions & 0 deletions server/app/cronjobs/catalyst-scheduler/catalystScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion server/app/model/classes/tasks/taskHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 3 additions & 4 deletions server/app/model/classes/tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ var taskSchema = new Schema({
},
manualExecutionTime:{
type: Number,
required: false,
default:10
required: false
}
});
taskSchema.plugin(mongoosePaginate);
Expand All @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions server/app/routes/v1.0/routes_organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions server/app/routes/v1.0/routes_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down