<commit_before>self.pollInterval = 2000;
self.pollUrl = "/mpdstatus";
self.addEventListener('message', function(e) {
	var data = e.data;
	switch (data.cmd) {
		case 'start':
			self.poll();
			break;
		case 'setMiliseconds':
			if(data.value < 2000) {
				self.postMessage('Invalid bvalue for miliseconds: ' + data.value + '! terminating worker...');
				self.close();
				break;
			}
			self.pollInterval = data.value;
			break;
		case 'setPollUrl':
			self.pollUrl = data.value;
			break;
		case 'refreshInterval':
			clearTimeout(self.poller);
			self.poll();
			break;
		case 'refreshIntervalDelayed':
			clearTimeout(self.poller);
			setTimeout(function(){self.poll('?force=1');},200);
			break;
		case 'stop':
			self.close();
			break;
	};
}, false);

self.poll = function(queryString) {
	var ajax = new XMLHttpRequest();
	//console.log('pollworker.pollUrl', self.pollUrl);
	ajax.open("GET", self.pollUrl + ((queryString)?queryString:''), true);
	ajax.onreadystatechange = function(){
		if(this.readyState == 4){
			if(this.status == 200){
				try {
					self.postMessage(JSON.parse(this.responseText));
				} catch(e) {
					self.postMessage('Poll-response is not parsable as JSON! terminating worker...');
					self.close();
				}
			} else{
				self.postMessage('Response status is not 200 but ' + this.statusText + '! terminating worker...');
				self.close();
			}
		}
	}
	ajax.send(null);
	self.poller = setTimeout(
		self.poll,
		self.pollInterval
	);
}
<commit_msg>fixed indentations and usage of single/doublequotes<commit_after>self.pollInterval = 2000;
self.pollUrl = "/mpdstatus";
self.addEventListener("message", function(e) {
	var data = e.data;
	switch (data.cmd) {
		case "start":
			self.poll();
			break;
		case "setMiliseconds":
			if(data.value < 2000) {
				self.postMessage("Invalid bvalue for miliseconds: " + data.value + "! terminating worker...");
				self.close();
				break;
			}
			self.pollInterval = data.value;
			break;
		case "setPollUrl":
			self.pollUrl = data.value;
			break;
		case "refreshInterval":
			clearTimeout(self.poller);
			self.poll();
			break;
		case "refreshIntervalDelayed":
			clearTimeout(self.poller);
			setTimeout(function(){self.poll("?force=1");},200);
			break;
		case "stop":
			self.close();
			break;
	}
}, false);

self.poll = function(queryString) {
	var ajax = new XMLHttpRequest();
	//console.log("pollworker.pollUrl", self.pollUrl);
	ajax.open("GET", self.pollUrl + ((queryString)?queryString:""), true);
	ajax.onreadystatechange = function(){
		if(this.readyState === XMLHttpRequest.DONE){
			if(this.status == 200){
				try {
					self.postMessage(JSON.parse(this.responseText));
				} catch(e) {
					self.postMessage("Poll-response is not parsable as JSON! terminating worker...");
					self.close();
				}
			} else{
				self.postMessage("Response status is not 200 but " + this.statusText + "! terminating worker...");
				self.close();
			}
		}
	}
	ajax.send(null);
	self.poller = setTimeout(
		self.poll,
		self.pollInterval
	);
};
{'fraction_non_alphanumeric': 0.16611405835543766, 'fraction_numerical': 0.01226790450928382, 'mean_word_length': 3.6061068702290076, 'pattern_counts': {'":': 6, '<': 5, '<?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': '7274093', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1009, 'n_words': 199}