Skip to content
Browse files

Merge pull request #187 from prey/fixes-graceful-shutdown

Fix graceful shutdown after initial config
  • Loading branch information...
2 parents 25147be + 3f6434d commit b17feecb555406d10d7365b745a7ee4de3badfdc @raliste raliste committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/agent/plugins/control-panel/index.js
View
6 lib/agent/plugins/control-panel/index.js
@@ -31,7 +31,7 @@ var init_api = function(opts, cb) {
}, cb);
}
-var wait_for_config = function() {
+var wait_for_config = function(cb) {
logger.warn('Not configured. Waiting for user input...');
var attempts = 0;
@@ -44,7 +44,7 @@ var wait_for_config = function() {
clearInterval(timer);
// set the new keys in the api before booting
- init_api(config.all(), function() { boot() });
+ init_api(config.all(), function() { boot(cb) });
} else if (++attempts > 30) { // five mins total
throw new Error('Not configured. Stopping.');
@@ -234,7 +234,7 @@ exports.load = function(cb) {
if (!common.helpers.running_on_background())
cb && cb(err); // throw err;
else
- wait_for_config();
+ wait_for_config(cb);
})
}

0 comments on commit b17feec

Please sign in to comment.
Something went wrong with that request. Please try again.