From 9366632259f77c500633b2d92d0f719da9f15436 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 21 Aug 2023 10:08:59 +0800 Subject: [PATCH] tidy up end exit on empty queue --- Notify.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Notify.php b/Notify.php index f4335e87..58bd3639 100644 --- a/Notify.php +++ b/Notify.php @@ -231,6 +231,10 @@ class Pman_Core_Notify extends Pman $w->autoJoin(); $total = $w->find(); + if (empty($total)) { + $this->logecho("Nothing In Queue - DONE"); + exit; + } if (!empty($opts['list'])) { @@ -281,7 +285,7 @@ class Pman_Core_Notify extends Pman $black = $this->isBlacklisted($email); if ($black !== false) { $this->logecho("DOMAIN blacklisted - {$email} - moving to another pool"); - $this->updateServer(clone($p), $black); + $this->updateServer($p, $black); continue; } @@ -355,10 +359,10 @@ class Pman_Core_Notify extends Pman // this sequentially distributes requeued emails.. - to other servers. (can exclude current one if we have that flagged.) function updateServer($ww, $exclude = -1) { -$w = DB_DataObject::factory($ww->tableName()); -$w->get($ww->id); - -$ff = HTML_FlexyFramework::get(); + $w = DB_DataObject::factory($ww->tableName()); + $w->get($ww->id); + + $ff = HTML_FlexyFramework::get(); static $num = 0; if (empty($ff->Core_Notify['servers'])) { return; -- 2.39.2