Start scheduler from host-scheduler
This commit is contained in:
parent
e26bed2e66
commit
4daa39bd2c
@ -24,7 +24,9 @@ HostScheduler.prototype.add = function(host, user, callback) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
var wasRunning = scheduler.add(user);
|
||||
scheduler.add(user);
|
||||
var wasRunning = scheduler.schedule();
|
||||
debug('Scheduler host=%s was running = %s', host, wasRunning);
|
||||
return callback(err, wasRunning);
|
||||
});
|
||||
};
|
||||
|
@ -25,12 +25,15 @@ Scheduler.prototype.add = function(user) {
|
||||
if (task.status === STATUS.DONE) {
|
||||
task.status = STATUS.PENDING;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
task = new TaskEntity(user);
|
||||
this.tasks.push(task);
|
||||
this.users[user] = task;
|
||||
|
||||
return false;
|
||||
}
|
||||
return this.schedule();
|
||||
};
|
||||
|
||||
Scheduler.prototype.schedule = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user