Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

Commit

Permalink
added restart method
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Condon committed Dec 4, 2011
1 parent bfa568c commit 914428c
Show file tree
Hide file tree
Showing 2 changed files with 545 additions and 7 deletions.
23 changes: 16 additions & 7 deletions lib/process.js
Expand Up @@ -34,7 +34,7 @@ var Process = module.exports = Structr({
for(var programName in programs)
{
//skip if already present
if(programName.indexOf(this.processId+'_') == 0) continue;
if(programName.indexOf(this.processId + '_') == 0) continue;

var name = this.processId + '_' + programName;

Expand All @@ -53,27 +53,36 @@ var Process = module.exports = Structr({
}
else
{
this.config.addProgram({ script: this.current.appDir, name: this.processId, environment: this.current.environment }, callback);
this.config.addProgram({ script: this.current.appDir, name: this.processId, environment: this.current.environment });
}

this.config.enable();
this.config.enable(callback);
},

/**
*/

'stop': function(callback)
{
this.config.disable();
this.config.disable(callback);
},

/**
*/

'restart': function(callback)
{
//doesn't work with multiple procs
//beet.restart(this.processId, callback);
}

console.log("Stopping");
var self = this;
this.stop(function() {
console.log('Stopped');
self.start(function(err, stdout, stderr) {
console.log("Started");
if(callback) callback(err, stdout, stderr);
})
})
},


});

0 comments on commit 914428c

Please sign in to comment.