<commit_before>var redis = require('redis');
var util = require('util');


// ### Errors ###

function RedisConnectionError(error) {
	this.name = 'RedisConnectionError';
	this.message = error;
}
util.inherits(RedisConnectionError, Error);


function RedisAdapter() {
	this.client = redis.createClient();
}

RedisAdapter.prototype.connect = function () {
	var self = this;

	return function (req, res, next) {
		self.client.on('error', function (error) {
			throw new RedisConnectionError(error);
		});
		next();
	};
};

module.exports.RedisAdapter = RedisAdapter;<commit_msg>Set max listeners for redis client connection.<commit_after>var redis = require('redis');
var util = require('util');


// ### Errors ###

function RedisConnectionError(error) {
	this.name = 'RedisConnectionError';
	this.message = error;
}
util.inherits(RedisConnectionError, Error);


function RedisAdapter() {
	this.client = redis.createClient();
	this.client.setMaxListeners(0);
}

RedisAdapter.prototype.connect = function () {
	var self = this;

	return function (req, res, next) {
		self.client.on('error', function (error) {
			throw new RedisConnectionError(error);
		});
		next();
	};
};

module.exports.RedisAdapter = RedisAdapter;
{'fraction_non_alphanumeric': 0.1513157894736842, 'fraction_numerical': 0.0008223684210526315, 'mean_word_length': 5.024752475247524, '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': '1600237', 'n_tokens_mistral': 404, 'n_tokens_neox': 391, 'n_words': 82}