From: Alan Date: Wed, 9 Aug 2023 07:43:41 +0000 (+0800) Subject: slightly better logging... and distribute requeue X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=6b7d7e76e976c0973033900fa1ed9d39b87da685 slightly better logging... and distribute requeue --- diff --git a/Notify.php b/Notify.php index 9dbca025..35843324 100644 --- a/Notify.php +++ b/Notify.php @@ -273,9 +273,11 @@ class Pman_Core_Notify extends Pman if ($pushed === false) { // we only try once to requeue.. + $this->logecho("REQUEING email for next run, as we have maxed out that domain"); $requeue[] = $p; continue; } + $this->logecho("PUSHING email, as we have maxed out that domain"); $pushed[] = $p; @@ -299,6 +301,7 @@ class Pman_Core_Notify extends Pman foreach($requeue as $p) { $pp = clone($p); $p->act_when = $p->sqlValue('NOW + INTERVAL 1 MINUTE'); + $this->updateServer($p); $p->update($pp); } @@ -308,7 +311,19 @@ class Pman_Core_Notify extends Pman exit; } - + // this sequentially distributes requeued emails.. - to other servers. + function updateServer($w) + { + $ff = HTML_FlexyFramework::get(); + static $num = 0; + if (empty($ff->Core_Notify['servers'])) { + return; + } + $num++; + // next server.. + $w->server_id = $num % count(array_keys($ff->Core_Notify['servers'])); + + } function generateNotifications()