<commit_before>var async = require('async');
var Query = require('mcquery');

var serverDomain = 'server.bakker.pw:9980';

function queryServerStats(port, callback) {
	
	var query = new Query('localhost', port);

	query.connect(function(connectError){
		if(connectError){
			//return callback(connectError)
			return callback(null, {'online':false});
		}
		query.full_stat(function(statError, stat){
		//query.basic_stat(function(statError, stat){
			if(statError){
				//return callback(statError)
				return callback(null, {'online':false});
			}
			//console.log(stat)
			query.close();
			stat.online = true;
			setImmediate(function(){
				callback(null, stat);
			});
		});
	});
}

module.exports = function(req, res){
	async.parallel({
		survivalStats: function(parallelCallback){
			queryServerStats(25561, parallelCallback);<commit_msg>Reduced timeout on minecraft route.  Cleanup<commit_after>var async = require('async');
var Query = require('mcquery');

function queryServerStats(port, callback) {
	
	var query = new Query('localhost', port, {timeout: 100});

	query.connect(function(connectError){
		if(connectError){
			return callback(null, {'online':false});
		}
		query.full_stat(function(statError, stat){
			if(statError){
				return callback(null, {'online':false});
			}
			//console.log(stat)
			query.close();
			stat.online = true;
			setImmediate(function(){
				callback(null, stat);
			});
		});
	});
}

module.exports = function(req, res){
	async.parallel({
		survivalStats: function(parallelCallback){
			queryServerStats(25561, parallelCallback);
{'fraction_non_alphanumeric': 0.15736040609137056, 'fraction_numerical': 0.010786802030456852, 'mean_word_length': 4.906367041198502, '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': '3350843', 'n_tokens_mistral': 569, 'n_tokens_neox': 485, 'n_words': 95}