From 39821b1ee7837cf357cc8b4220ad2fd1ddcf3a03 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Fri, 17 Jan 2025 09:13:21 -0500 Subject: [PATCH] QA: Stop mailer errors and add frequency to debounce - Without the frequency, we can not prune the entries via the maintenance script. --- lib/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index 1ea932bae..5b54a91ef 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -5322,7 +5322,7 @@ function mailer(array|string $from, array|string $to, null|array|string $cc = nu $body = $body ?? ''; // Create the PHPMailer instance - $mail = new PHPMailer\PHPMailer\PHPMailer; + $mail = new PHPMailer\PHPMailer; // Set a reasonable timeout of 5 seconds $timeout = read_config_option('settings_smtp_timeout'); @@ -8848,8 +8848,9 @@ function debounce_run_notification($id, $frequency = 7200) { if (empty($last_timestamp) || $now - $last_timestamp > $frequency) { $current = array( + 'id' => $id, 'timestamp' => $now, - 'id' => $id + 'frequency' => $frequency ); set_config_option($key, json_encode($current));