<commit_before>var _ = require('underscore');
var path = require('path');
var Promise = require('bluebird');
var Inotify = require('inotify').Inotify;
var mkdirp = require('mkdirp');
var rimraf = Promise.promisify(require('rimraf'));
var fs = Promise.promisifyAll(require('fs'));
var async = require('async');
var kue = require('kue');

var serviceLocator = require('../service-locator');
var JobHandlerRegistry = require('./handler-registry');
Promise.config({cancellation: true});

/**
 * @param {String} jobDirectory, an Absolute one!
 * @param {String} tempFilesDir, an Absolute one!
 * @param {Array} handlers
 * @constructor
 */
function JobManager(jobDirectory, tempFilesDir, handlers) {
  if (!fs.statSync(jobDirectory).isDirectory()) {
    throw new Error('`jobDirectory` must be a directory');
  }
  this._failureBackoff = 20000;
  this._jobsDirectory = jobDirectory;
  this._tempFilesDir = tempFilesDir;
  this._inotify = new Inotify();
  this._watch = null;

  this.handlerRegistry = new JobHandlerRegistry();<commit_msg>Remove async<commit_after>var _ = require('underscore');
var path = require('path');
var Promise = require('bluebird');
var Inotify = require('inotify').Inotify;
var mkdirp = require('mkdirp');
var rimraf = Promise.promisify(require('rimraf'));
var fs = Promise.promisifyAll(require('fs'));
var kue = require('kue');

var serviceLocator = require('../service-locator');
var JobHandlerRegistry = require('./handler-registry');
Promise.config({cancellation: true});

/**
 * @param {String} jobDirectory, an Absolute one!
 * @param {String} tempFilesDir, an Absolute one!
 * @param {Array} handlers
 * @constructor
 */
function JobManager(jobDirectory, tempFilesDir, handlers) {
  if (!fs.statSync(jobDirectory).isDirectory()) {
    throw new Error('`jobDirectory` must be a directory');
  }
  this._failureBackoff = 20000;
  this._jobsDirectory = jobDirectory;
  this._tempFilesDir = tempFilesDir;
  this._inotify = new Inotify();
  this._watch = null;

  this.handlerRegistry = new JobHandlerRegistry();
{'fraction_non_alphanumeric': 0.15233415233415235, 'fraction_numerical': 0.004914004914004914, 'mean_word_length': 5.741721854304636, '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': '3173099', 'n_tokens_mistral': 634, 'n_tokens_neox': 609, 'n_words': 151}