From a38e62c4127454b5f53c9b6e56dbe88f53b7ea36 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 11 Jan 2024 00:32:31 -0500 Subject: [PATCH] Set lock file cront ticket email parser from 600 sec aka 10 mins to 300 secs aa 5 mins, update telemetry to include website --- cron.php | 1 + cron_ticket_email_parser.php | 4 ++-- post/setting.php | 2 ++ setup.php | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cron.php b/cron.php index 1dc46bc1..c0d67664 100644 --- a/cron.php +++ b/cron.php @@ -889,6 +889,7 @@ if ($config_telemetry > 0 OR $config_telemetry = 2) { 'installation_id' => "$installation_id", 'version' => "$current_version", 'company_name' => "$company_name", + 'website' => "$company_website", 'city' => "$company_city", 'state' => "$company_state", 'country' => "$company_country", diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php index 8b7d836e..fe2a71d5 100644 --- a/cron_ticket_email_parser.php +++ b/cron_ticket_email_parser.php @@ -62,8 +62,8 @@ $lock_file_path = "{$temp_dir}/itflow_email_parser_{$installation_id}.lock"; if (file_exists($lock_file_path)) { $file_age = time() - filemtime($lock_file_path); - // If file is older than 10 minutes (600 seconds), delete and continue - if ($file_age > 600) { + // If file is older than 5 minutes (300 seconds), delete and continue + if ($file_age > 300) { unlink($lock_file_path); mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron-Email-Parser', log_action = 'Delete', log_description = 'Cron Email Parser detected a lock file was present but was over 10 minutes old so it removed it'"); } else { diff --git a/post/setting.php b/post/setting.php index 2458cdc5..de9b0f9a 100644 --- a/post/setting.php +++ b/post/setting.php @@ -596,6 +596,7 @@ if (isset($_GET['update'])) { $row = mysqli_fetch_array($sql); $company_name = sanitizeInput($row['company_name']); + $website = sanitizeInput($row['company_website']); $city = sanitizeInput($row['company_city']); $state = sanitizeInput($row['company_state']); $country = sanitizeInput($row['company_country']); @@ -767,6 +768,7 @@ if (isset($_GET['update'])) { 'installation_id' => "$installation_id", 'version' => "$current_version", 'company_name' => "$company_name", + 'website' => "$website", 'city' => "$city", 'state' => "$state", 'country' => "$country", diff --git a/setup.php b/setup.php index 27b2dc45..808cc21a 100644 --- a/setup.php +++ b/setup.php @@ -309,6 +309,7 @@ if (isset($_POST['add_telemetry'])) { $row = mysqli_fetch_array($sql); $company_name = $row['company_name']; + $website = $row['company_website']; $city = $row['company_city']; $state = $row['company_state']; $country = $row['company_country']; @@ -318,6 +319,7 @@ if (isset($_POST['add_telemetry'])) { array( 'installation_id' => "$installation_id", 'company_name' => "$company_name", + 'website' => "$website", 'city' => "$city", 'state' => "$state", 'country' => "$country",