<commit_before>module.exports = function (sails) {

  /**
   * Module dependencies.
   */

  var async     = require('async');


  return function startServer (cb) {

    // Used to warn about possible issues if starting the server is taking a long time
    var liftAbortTimer;
    var liftTimeout = sails.config.liftTimeout || 4000;

    async.auto({

      // Start Express server
      start: function (cb) {

        var explicitHost = sails.config.explicitHost;

        // If host is explicitly declared, include it in express's listen() call
        if (explicitHost) {
          sails.log.verbose('Restricting access to explicit host: '+explicitHost);
          sails.hooks.http.server.listen(sails.config.port, explicitHost, cb);
        }
        else {
          sails.hooks.http.server.listen(sails.config.port, cb);
        }

        // Start timer in case this takes suspiciously long...
        liftAbortTimer = setTimeout(function failedToStart() {

          // Figure out if this user is on Windows
          var isWin = !!process.platform.match(/^win/);

          // If server isn't starting, provide general troubleshooting information,
          // sharpened with a few simple heuristics:
          console.log('');<commit_msg>Don't display messages about Sails taking a long time to start if it has already exited. This can happen if an error occurs while lifting a Sails app programmatically.<commit_after>module.exports = function (sails) {

  /**
   * Module dependencies.
   */

  var async     = require('async');


  return function startServer (cb) {

    // Used to warn about possible issues if starting the server is taking a long time
    var liftAbortTimer;
    var liftTimeout = sails.config.liftTimeout || 4000;

    async.auto({

      // Start Express server
      start: function (cb) {

        var explicitHost = sails.config.explicitHost;

        // If host is explicitly declared, include it in express's listen() call
        if (explicitHost) {
          sails.log.verbose('Restricting access to explicit host: '+explicitHost);
          sails.hooks.http.server.listen(sails.config.port, explicitHost, cb);
        }
        else {
          sails.hooks.http.server.listen(sails.config.port, cb);
        }

        // Start timer in case this takes suspiciously long...
        liftAbortTimer = setTimeout(function failedToStart() {

          // If sails is exiting already, don't worry about the timer going off.
          if (sails._exiting) {return;}

          // Figure out if this user is on Windows
          var isWin = !!process.platform.match(/^win/);

          // If server isn't starting, provide general troubleshooting information,
          // sharpened with a few simple heuristics:
          console.log('');
{'fraction_non_alphanumeric': 0.09510086455331412, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 2.3865853658536587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4590305', 'n_tokens_mistral': 764, 'n_tokens_neox': 714, 'n_words': 252}