<commit_before>// Module dependencies
var cluster = require('cluster'),
    express = require('express'),
    http = require('http');

var app = express(),
    env = app.settings.env;

var settings = require('./config/settings').init(app, express)(),
    logger = require('./lib/logger').init(settings.winston),
    i18n = require('i18next').init(settings.i18next);

var log = logger();

if (cluster.isMaster) {

    log.info('master is running in ' + '%s'.bold.green + ' mode', env);
    log.info('NodeJS-%s-%s', process.version, process.platform);
    log.info('Express-%s', express.version);

    // Fork workers
    var cpus = require('os').cpus().length;
    for (var i = 0; i < cpus; ++i) {
        cluster.fork();
    }

    // Event: message
    Object.keys(cluster.workers).forEach(function(id) {
        cluster.workers[id].on('message', function(msg) {
            if (msg.cmd === 'bonjour') {
                log.debug('Received a bonjour command from worker #%d(pid=%d)', this.id, this.process.pid);
                this.send({reply: 'ok'});
            }<commit_msg>Change the current working directory to ensure that files are relative to the current directory.<commit_after>// Change the current working directory to ensure that files are relative to the current directory.
process.chdir(__dirname);

// Module dependencies
var cluster = require('cluster'),
    express = require('express'),
    http = require('http');

var app = express(),
    env = app.settings.env;

var settings = require('./config/settings').init(app, express)(),
    logger = require('./lib/logger').init(settings.winston),
    i18n = require('i18next').init(settings.i18next);

var log = logger();

if (cluster.isMaster) {

    log.info('The app is running in ' + '%s'.bold.green + ' mode', env);
    log.info('Starting directory:', process.cwd());
    log.info('NodeJS-%s-%s-%s', process.version, process.platform, process.arch);
    log.info('Express-%s', express.version);

    // Fork workers
    var cpus = require('os').cpus().length;
    for (var i = 0; i < cpus; ++i) {
        cluster.fork();
    }

    // Event: message
    Object.keys(cluster.workers).forEach(function(id) {
        cluster.workers[id].on('message', function(msg) {
            if (msg.cmd === 'bonjour') {
                log.debug('Received a bonjour command from worker #%d(pid=%d)', this.id, this.process.pid);
                this.send({reply: 'ok'});
            }
{'fraction_non_alphanumeric': 0.175, 'fraction_numerical': 0.005737704918032787, 'mean_word_length': 3.0347107438016527, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4059344', 'n_tokens_mistral': 747, 'n_tokens_neox': 722, 'n_words': 179}