diff --git a/lib/hooks/http/index.js b/lib/hooks/http/index.js index 5d09db202..eb8075b2f 100644 --- a/lib/hooks/http/index.js +++ b/lib/hooks/http/index.js @@ -29,6 +29,9 @@ module.exports = function(sails) { // Port to run this app on port: 1337, + // How long before warning Sails is taking too long to lift. + liftTimeout: 4000, + // SSL cert settings end up here ssl: {}, diff --git a/lib/hooks/http/start.js b/lib/hooks/http/start.js index b8a61045e..3913975d0 100644 --- a/lib/hooks/http/start.js +++ b/lib/hooks/http/start.js @@ -12,9 +12,6 @@ module.exports = function (sails) { // Used to warn about possible issues if starting the server is taking a long time var liftAbortTimer; - var liftTimeout = sails.config.liftTimeout || 4000; - // TODO: pull this defaulting into `defaults` - // and also ensure this config is properly documented. async.auto({ @@ -40,7 +37,7 @@ module.exports = function (sails) { } // Start timer in case this takes suspiciously long... - liftAbortTimer = setTimeout(failedToStart, liftTimeout); + liftAbortTimer = setTimeout(failedToStart, sails.config.liftTimeout); // If the server fails to start because of an error, or if it's just taking // too long, show some troubleshooting notes and bail out.