<commit_before><?php
	include "inc/init.php";

	$result = mysql_queryf("SELECT run_id FROM run_useragent WHERE useragent_id=%u AND runs < max ORDER BY run_id DESC LIMIT 1;", $useragent_id);
	
	# A run was found
	if ( $row = mysql_fetch_array($result) ) {
		$run_id = $row[0];

		$result = mysql_queryf("SELECT url FROM runs WHERE id=%u LIMIT 1;", $run_id);

		# TODO: Return more run info to the client (Name, etc.)
		if ( $row = mysql_fetch_array($result) ) {
			$url = $row[0];
		}
	
		# Make sure that we don't re-run the tests in the same client
		$result = mysql_queryf("SELECT 1 FROM run_client WHERE run_id=%u AND client_id=%u LIMIT 1;", $run_id, $client_id);

		if ( mysql_num_rows($result) == 0 ) {
			# Mark the run as "in progress" on the useragent
			mysql_queryf("UPDATE run_useragent SET runs = runs + 1, status = 1 WHERE run_id=%u AND useragent_id=%u LIMIT 1;", $run_id, $useragent_id);

			# Initialize the client run
			mysql_queryf("INSERT INTO run_client (run_id,client_id,status,created) VALUES(%u,%u,1,NOW());", $run_id, $client_id);

			echo "$run_id $url";
		}
	}

	exit();
?><commit_msg>Removed the limit on re-running tests in the same client.<commit_after><?php
	include "inc/init.php";

	$result = mysql_queryf("SELECT run_id FROM run_useragent WHERE useragent_id=%u AND runs < max ORDER BY run_id DESC LIMIT 1;", $useragent_id);
	
	# A run was found
	if ( $row = mysql_fetch_array($result) ) {
		$run_id = $row[0];

		$result = mysql_queryf("SELECT url FROM runs WHERE id=%u LIMIT 1;", $run_id);

		# TODO: Return more run info to the client (Name, etc.)
		if ( $row = mysql_fetch_array($result) ) {
			$url = $row[0];
		}
	
		# Mark the run as "in progress" on the useragent
		mysql_queryf("UPDATE run_useragent SET runs = runs + 1, status = 1 WHERE run_id=%u AND useragent_id=%u LIMIT 1;", $run_id, $useragent_id);

		# Initialize the client run
		mysql_queryf("INSERT INTO run_client (run_id,client_id,status,created) VALUES(%u,%u,1,NOW());", $run_id, $client_id);

		echo "$run_id $url";
	}

	exit();
?>
{'fraction_non_alphanumeric': 0.14054054054054055, 'fraction_numerical': 0.009336609336609337, 'mean_word_length': 4.386243386243386, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '459101', 'n_tokens_mistral': 796, 'n_tokens_neox': 728, 'n_words': 225}