<commit_before>//process.env.NODE_CONFIG_DIR = process.cwd() + '/config/env';

var config = require('config');
console.log(config);

/* Also useful to only get Service-specific config:
  var config = require('config').get('engine');
*/

function doWork() {
  //console.log('staying alive. keeping busy.');
}

var intId = setInterval(doWork,5000);



process.on('SIGINT', function() {
  // My process has received a SIGINT signal
  // Meaning PM2 is now trying to stop the process

  // So I can clean some stuff before the final stop
  clearInterval(intId);

  setTimeout(function() {
    // 300ms later the process kill it self to allow a restart
    //process.exit(0);
  }, 300);
});<commit_msg>more cleanup of the code<commit_after>var config = require('config');

function doWork() {
  console.log('staying alive. keeping busy.');
}

var runLoop = setInterval(doWork,5000);

process.on('SIGINT', function() {
  clearInterval(runLoop);

  // setTimeout(function() {
  //  // TODO What is the corect way to cleanup, then exit on SIGINT?
  //  process.exit(0);
  // }, 300);
});
{'fraction_non_alphanumeric': 0.15106580166821132, 'fraction_numerical': 0.018535681186283594, 'mean_word_length': 3.7577092511013217, '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': '6176791', 'n_tokens_mistral': 352, 'n_tokens_neox': 332, 'n_words': 103}