Permalink
Browse files

fixed behavior of nac <app> start

  • Loading branch information...
1 parent cdf1961 commit e7059db903eddcead0cde78cedf0380a209e7907 @spion committed Jul 3, 2013
Showing with 9 additions and 4 deletions.
  1. +6 −1 lib/daemon/app.js
  2. +3 −3 test/ndaemon-badapp.js
View
@@ -194,8 +194,13 @@ App.prototype._runProcess = function (done) {
App.prototype.start = function (cb) {
var self = this;
- if (this.started || this.active)
+ if (this.started)
return cb(new Error("app " + this.name + " already started"));
+
+ if (this._respawner) {
+ clearTimeout(this._respawner);
+ this._respawner = null;
+ }
this.active = true;
this.started = Date.now();
this.emit('before-start');
View
@@ -33,9 +33,9 @@ module.exports = function(t) {
t.end();
})
});
- dt.test('started app cannot be started twice', function(t) {
+ dt.test('started bad app can be started twice', function(t) {
c.start('test-bad', function(err, apps) {
- t.ok(err, 'app start error: ' + err);
+ t.notOk(err, 'app start error: ' + err);
t.end();
});
})
@@ -89,4 +89,4 @@ module.exports = function(t) {
};
if (!process.env.COVER)
- module.exports(require('tap'));
+ module.exports(require('tap'));

0 comments on commit e7059db

Please sign in to comment.