<commit_before><?php
// Availiable $_SESSION variables:
//  CurrLoc: Integer tied to Locations Table UID
//  CharUID: Integer tied to Character_Details UID
//  CharName: String of the Characater Name
//  IsGM: Boolean of whether or not this is a GM account
//  LoggedIn: "Yes" or not "Yes" answer to the question "Is there a logged in person?"
//  TZ: String containng a timezone


// This page is not designed to be accessed by a human, but rather by a kron-job

$con=mysqli_connect("database.db","username","password","Characters");
$ud=mysqli_connect("database.db","username","password","Characters");

switch ($_REQUEST["Type"])
{
  case "Daily":
		$ArchiveQry1="INSERT INTO Conversations_bkup SELECT * FROM Conversations WHERE Conversations.TDS < now()-3600";
		$ArchiveQry2="DELETE FROM Conversations WHERE Conversations.TDS < Now()-3600";
		$OptimizeQry1="OPTIMIZE TABLE Conversations";
		$OptimizeQry2="OPTIMIZE TABLE Conversations_bkup";
		
		$qry=mysqli_query($ud,$ArchiveQry1);
		$qry=mysqli_query($ud,$ArchiveQry2);
		$qry=mysqli_query($ud,$OptimizeQry1);
		$qry=mysqli_query($ud,$OptimizeQry2);
		
		break;
	case "Weekly":
		$OptimizeQryBase="OPTIMIZE TABLE ";
		$Tables=array("Character_Details","Conversations","Conversations_bkup","Locations","Logins","Powers","PowersLink");
		for ($i=0; $i<count($Tables); $i++)
		{
			$qry=mysqli_query($ud,$OptimizeQryBase . $Tables[$i]);
		}
		break;
}

mysqli_close($ud);
mysqli_close($con);
?><commit_msg>kronjob.php: Bug #8<commit_after><?php
// Availiable $_SESSION variables:
//  CurrLoc: Integer tied to Locations Table UID
//  CharUID: Integer tied to Character_Details UID
//  CharName: String of the Characater Name
//  IsGM: Boolean of whether or not this is a GM account
//  LoggedIn: "Yes" or not "Yes" answer to the question "Is there a logged in person?"
//  TZ: String containng a timezone


// This page is not designed to be accessed by a human, but rather by a kron-job

require 'components/connections.php';

switch ($_REQUEST["Type"])
{
	case "Daily":
		$ArchiveQry1="INSERT INTO Conversations_bkup SELECT * FROM Conversations WHERE Conversations.TDS < now()-3600";
		$ArchiveQry2="DELETE FROM Conversations WHERE Conversations.TDS < Now()-3600";
		$OptimizeQry1="OPTIMIZE TABLE Conversations";
		$OptimizeQry2="OPTIMIZE TABLE Conversations_bkup";
		
		$qry=mysqli_query($ud,$ArchiveQry1);
		$qry=mysqli_query($ud,$ArchiveQry2);
		$qry=mysqli_query($ud,$OptimizeQry1);
		$qry=mysqli_query($ud,$OptimizeQry2);
		
		break;
	case "Weekly":
		$OptimizeQryBase="OPTIMIZE TABLE ";
		$Tables=array("Character_Details","Conversations","Conversations_bkup","Locations","Logins","Powers","PowersLink");
		for ($i=0; $i<count($Tables); $i++)
		{
			$qry=mysqli_query($ud,$OptimizeQryBase . $Tables[$i]);
		}
		break;
}
require 'components/footer.php';
?>
{'fraction_non_alphanumeric': 0.14660986865459708, 'fraction_numerical': 0.012424565140220093, 'mean_word_length': 5.64622641509434, 'pattern_counts': {'":': 4, '<': 11, '<?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': '593107', 'n_tokens_mistral': 1089, 'n_tokens_neox': 989, 'n_words': 234}