From 9c66c3b7415ede5b7fdf63e37ed956d34743a2bc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Jan 2023 18:29:35 +1100 Subject: [PATCH] Fixes for ninja mailer --- app/Jobs/Mail/NinjaMailerJob.php | 11 ++++++----- app/Services/Email/EmailMailer.php | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index ceb8d107e0..f7bcf5a8f3 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -206,11 +206,11 @@ class NinjaMailerJob implements ShouldQueue app('sentry')->captureException($e); } - - } + + /* Releasing immediately does not add in the backoff */ + $this->release($this->backoff()[$this->attempts()-1]); - /* Releasing immediately does not add in the backoff */ - $this->release($this->backoff()[$this->attempts()-1]); + } /*Clean up mailers*/ $this->cleanUpMailers(); @@ -649,7 +649,8 @@ class NinjaMailerJob implements ShouldQueue public function failed($exception = null) { - + if($exception) + nlog($exception->getMessage()); } } \ No newline at end of file diff --git a/app/Services/Email/EmailMailer.php b/app/Services/Email/EmailMailer.php index 4c8efee509..897c69d2a6 100644 --- a/app/Services/Email/EmailMailer.php +++ b/app/Services/Email/EmailMailer.php @@ -141,10 +141,12 @@ class EmailMailer implements ShouldQueue $this->release($this->backoff()[$this->attempts()-1]); $message = null; - $this->cleanUpMailers(); + } + $this->cleanUpMailers(); + } /**