<commit_before>var pm2 = require('pm2');
var async = require('async');
var config = require('./config');
var args = process.argv.slice(2);
var services = require("./deploy.json");
var apps = services.apps;
if (config.ROLE === "retriever" || config.ROLE == "proxy") {
    //don't use pm2 for these node types
    require('./' + config.ROLE + ".js");
}
else {
    pm2.connect(function() {
        async.each(apps, function(app, cb) {
            if (args[0] === "all" || app.role === config.ROLE || app.role === args[0]) {
                if (app.role === "fullhistory") {
                    //scale fh worker based on number of steam proxies
                    app.instances = config.STEAM_API_HOST.split(",").length;
                }
                pm2.start(app, cb);
            }
            else {
                cb();
            }
        }, function() {
            pm2.disconnect();
            process.exit(0);
        });
    });
}<commit_msg>use script name to detect<commit_after>var pm2 = require('pm2');
var async = require('async');
var config = require('./config');
var args = process.argv.slice(2);
var services = require("./deploy.json");
var apps = services.apps;
if (config.ROLE === "retriever" || config.ROLE == "proxy") {
    //don't use pm2 for these node types
    require('./' + config.ROLE + ".js");
}
else {
    pm2.connect(function() {
        async.each(apps, function(app, cb) {
            if (args[0] === "all" || app.role === config.ROLE || app.role === args[0]) {
                if (app.script === "fullhistory.js") {
                    //scale fh worker based on number of steam proxies
                    app.instances = config.STEAM_API_HOST.split(",").length;
                }
                pm2.start(app, cb);
            }
            else {
                cb();
            }
        }, function() {
            pm2.disconnect();
            process.exit(0);
        });
    });
}
{'fraction_non_alphanumeric': 0.17227108122090015, 'fraction_numerical': 0.010346611484738748, 'mean_word_length': 1.7707736389684814, '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': '438275', 'n_tokens_mistral': 587, 'n_tokens_neox': 567, 'n_words': 136}