From: Alan Date: Wed, 9 Aug 2023 09:31:16 +0000 (+0800) Subject: rejig process X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=2563008dc5a1907b1a1149c65f9456b7bacfa60c rejig process --- diff --git a/Notify.php b/Notify.php index 8c176a6d..505c82aa 100644 --- a/Notify.php +++ b/Notify.php @@ -288,20 +288,26 @@ class Pman_Core_Notify extends Pman } + if (!empty($this->next_queue)) { + $this->logecho("REQUEUING all emails that maxed out:" . count($this->next_queue)); + foreach($this->next_queue as $p) { + $pp = clone($p); + $p->act_when = $p->sqlValue('NOW + INTERVAL 1 MINUTE'); + $this->updateServer($p); + $p->update($pp); + + } + } + + $this->logecho("QUEUE COMPLETE - waiting for pool to end"); // we should have a time limit here... while(count($this->pool)) { $this->poolfree(); sleep(3); } - foreach($this->next_queue as $p) { - $pp = clone($p); - $p->act_when = $p->sqlValue('NOW + INTERVAL 1 MINUTE'); - $this->updateServer($p); - $p->update($pp); - - } + $this->logecho("DONE");