<commit_before>/**
 * function start (options)
 *
 * param @options {Object} Options to start a daemon
 * option {
 *  script:            {String} [optional/default: 'server.js'] script file to start
 *      parameter:     {Array}  [optional] parameter to pass to the script
 *      maxAttempts:   {Number} [optional/default: 10] max restart attempts
 *      minUptime:     {Number} [optional/default: 2000] how long the app has to be up (minimum time)
 *      spinSleepTime: {Number} [optional/default: 1000] time intervall of restart
 * }
 *
 * param @mail {String} specify notification email adress
 * 
 */

var forever    = require("forever"),
    nodemailer = require("nodemailer"),
    util       = require("util");

var params    = [process.argv[2] || __dirname + "/config.js"],
    config    = require(params[0]).forever || {},
    lastError = "";

if (config.mail) {

    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
    if (!filter.test(config.mail)) {
    
        throw new Error( "Error: Notification set active, but no valid mail has been set!" );
    }
    
    nodemailer.sendmail = true;
}

//default values
config.maxAttempts   = config.maxAttempts   || 23;
config.minUptime     = config.minUptime     || 2000;
config.spinSleepTime = config.spinSleepTime || 1000;

console.log(JSON.stringify(config));
return;

if (config.spinSleepTime >= config.minUptime) {
    
    throw new Error( "Error: spinSleepTime is greater than minUptime!" );
}

//watch node process
var server = new forever.Monitor(__dirname + "/core/router.js", {

    max             : config.maxAttempts,
    minUptime       : config.minUptime,
    spinSleepTime   : config.spinSleepTime,
    options         : params,
    silent          : true
});

//file load error
server.on("error", function() {
    
    util.log("Error: Loading HTTP Server [Parameter: " + params.join(", ") + "] as daemon failed!");
});
<commit_msg>removed wrong return statement in start.js<commit_after>/**
 * function start (options)
 *
 * param @options {Object} Options to start a daemon
 * option {
 *  script:            {String} [optional/default: 'server.js'] script file to start
 *      parameter:     {Array}  [optional] parameter to pass to the script
 *      maxAttempts:   {Number} [optional/default: 10] max restart attempts
 *      minUptime:     {Number} [optional/default: 2000] how long the app has to be up (minimum time)
 *      spinSleepTime: {Number} [optional/default: 1000] time intervall of restart
 * }
 *
 * param @mail {String} specify notification email adress
 * 
 */

var forever    = require("forever"),
    nodemailer = require("nodemailer"),
    util       = require("util");

var params    = [process.argv[2] || __dirname + "/config.js"],
    config    = require(params[0]).forever || {},
    lastError = "";

if (config.mail) {

    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
    if (!filter.test(config.mail)) {
    
        throw new Error( "Error: Notification set active, but no valid mail has been set!" );
    }
    
    nodemailer.sendmail = true;
}

//default values
config.maxAttempts   = config.maxAttempts   || 23;
config.minUptime     = config.minUptime     || 2000;
config.spinSleepTime = config.spinSleepTime || 1000;

if (config.spinSleepTime >= config.minUptime) {
    
    throw new Error( "Error: spinSleepTime is greater than minUptime!" );
}

//watch node process
var server = new forever.Monitor(__dirname + "/core/router.js", {

    max             : config.maxAttempts,
    minUptime       : config.minUptime,
    spinSleepTime   : config.spinSleepTime,
    options         : params,
    silent          : true
});

//file load error
server.on("error", function() {
    
    util.log("Error: Loading HTTP Server [Parameter: " + params.join(", ") + "] as daemon failed!");
});

{'fraction_non_alphanumeric': 0.14882641217436163, 'fraction_numerical': 0.015475883415011608, 'mean_word_length': 2.8169291338582676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4748608', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1221, 'n_words': 325}