<commit_before>package helper;

import java.io.File;
import java.lang.Process;
import java.lang.ProcessBuilder;
import models.Gatherconf;
import play.Logger;

public class WpullThread extends Thread {

	Gatherconf conf = null;
	ProcessBuilder pb = null;
	File log = null;

	private static final Logger.ALogger WebgatherLogger =
			Logger.of("webgatherer");

	public WpullThread(Gatherconf conf, ProcessBuilder pb, File log) {
		this.conf = conf;
		this.pb = pb;
		this.log = log;
	}

	public void run() {
		try {
			Process proc = pb.start();
			assert pb.redirectInput() == ProcessBuilder.Redirect.PIPE;
			assert pb.redirectOutput().file() == log;
			assert proc.getInputStream().read() == -1;
			int exitState = proc.waitFor();
			/**
			 * Mögliche Exit-Status: 0 = Crawl erfolgreich beendet, "INFO FINISHED."
			 */
			WebgatherLogger.info("Webcrawl for " + conf.getName()
					+ " exited with exitState " + exitState);
		} catch (Exception e) {
			WebgatherLogger.error(e.toString());
			throw new RuntimeException("wpull crawl not successfully started!", e);
		}
	}

}<commit_msg>Re-crawl if exit state is not equal to zero<commit_after>package helper;

import java.io.File;
import java.lang.Process;
import java.lang.ProcessBuilder;
import models.Gatherconf;
import play.Logger;

public class WpullThread extends Thread {

	Gatherconf conf = null;
	ProcessBuilder pb = null;
	File log = null;

	private static final Logger.ALogger WebgatherLogger =
			Logger.of("webgatherer");

	public WpullThread(Gatherconf conf, ProcessBuilder pb, File log) {
		this.conf = conf;
		this.pb = pb;
		this.log = log;
	}

	public void run() {
		try {
			Process proc = pb.start();
			assert pb.redirectInput() == ProcessBuilder.Redirect.PIPE;
			assert pb.redirectOutput().file() == log;
			assert proc.getInputStream().read() == -1;
			int exitState = proc.waitFor();
			/**
			 * Mögliche Exit-Status: 0 = Crawl erfolgreich beendet, "INFO FINISHED."
			 */
			WebgatherLogger.info("Webcrawl for " + conf.getName()
					+ " exited with exitState " + exitState);
			if (exitState != 0) {
				// Crawl wird erneut angestoßen
				WpullThread wpullThread = new WpullThread(conf, pb, log);
				wpullThread.start();
			}
		} catch (Exception e) {
			WebgatherLogger.error(e.toString());
			throw new RuntimeException("wpull crawl not successfully started!", e);
		}
	}

}
{'fraction_non_alphanumeric': 0.12346202800169707, 'fraction_numerical': 0.0021213406873143827, 'mean_word_length': 3.754032258064516, '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': '3366486', 'n_tokens_mistral': 849, 'n_tokens_neox': 767, 'n_words': 204}