From f03533b62af55ad6a2ba4706df99f67ba6e6eb21 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 3 Nov 2024 00:16:48 +1100 Subject: [PATCH] Ensure our jobs are storing objects without relations --- app/Jobs/AddressIdle.php | 4 ++-- app/Jobs/AddressIdleDomain.php | 7 ------- app/Jobs/AddressPoll.php | 4 ++-- app/Jobs/EchoareaImport.php | 2 +- app/Jobs/FileareaImport.php | 2 +- app/Jobs/MessageProcess.php | 2 +- app/Jobs/PacketProcess.php | 2 +- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/Jobs/AddressIdle.php b/app/Jobs/AddressIdle.php index 663ee1f..74538ea 100644 --- a/app/Jobs/AddressIdle.php +++ b/app/Jobs/AddressIdle.php @@ -37,8 +37,8 @@ class AddressIdle implements ShouldQueue */ public function __construct(Domain $do,Address $ao=NULL) { - $this->do = $do; - $this->ao = $ao; + $this->do = $do->withoutRelations(); + $this->ao = $ao?->withoutRelations(); } /** diff --git a/app/Jobs/AddressIdleDomain.php b/app/Jobs/AddressIdleDomain.php index 1e7d5e6..7ef9972 100644 --- a/app/Jobs/AddressIdleDomain.php +++ b/app/Jobs/AddressIdleDomain.php @@ -14,13 +14,6 @@ class AddressIdleDomain implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - /** - * Create a new job instance. - */ - public function __construct() - { - } - /** * Execute the job. */ diff --git a/app/Jobs/AddressPoll.php b/app/Jobs/AddressPoll.php index debb997..57b5099 100644 --- a/app/Jobs/AddressPoll.php +++ b/app/Jobs/AddressPoll.php @@ -38,8 +38,8 @@ class AddressPoll implements ShouldQueue, ShouldBeUnique public function __construct(Address $ao,Mailer $mo=NULL) { - $this->ao = $ao; - $this->mo = $mo; + $this->ao = $ao->withoutRelations(); + $this->mo = $mo?->withoutRelations(); $this->onQueue(self::QUEUE); } diff --git a/app/Jobs/EchoareaImport.php b/app/Jobs/EchoareaImport.php index 2a42aee..f80139f 100644 --- a/app/Jobs/EchoareaImport.php +++ b/app/Jobs/EchoareaImport.php @@ -36,7 +36,7 @@ class EchoareaImport implements ShouldQueue public function __construct(string $file,Domain $do,string $prefix='',bool $delete_recs=FALSE,bool $delete_file=FALSE) { $this->file = $file; - $this->do = $do; + $this->do = $do->withoutRelations(); $this->prefix = $prefix ?: ''; $this->delete_file = $delete_file; $this->delete_recs = $delete_recs; diff --git a/app/Jobs/FileareaImport.php b/app/Jobs/FileareaImport.php index 96ba805..7b54e8a 100644 --- a/app/Jobs/FileareaImport.php +++ b/app/Jobs/FileareaImport.php @@ -36,7 +36,7 @@ class FileareaImport implements ShouldQueue public function __construct(string $file,Domain $do,string $prefix='',bool $delete_recs=FALSE,bool $delete_file=FALSE) { $this->file = $file; - $this->do = $do; + $this->do = $do->withoutRelations(); $this->prefix = $prefix ?: ''; $this->delete_file = $delete_file; $this->delete_recs = $delete_recs; diff --git a/app/Jobs/MessageProcess.php b/app/Jobs/MessageProcess.php index 7e370ba..333b5f3 100644 --- a/app/Jobs/MessageProcess.php +++ b/app/Jobs/MessageProcess.php @@ -34,7 +34,7 @@ class MessageProcess implements ShouldQueue public function __construct(Echomail|Netmail $mo,bool $skipbot=FALSE) { // @todo We need to serialize this model here, because laravel has an error unserializing it (Model Not Found) - $this->mo = utf8_encode(serialize($mo)); + $this->mo = utf8_encode(serialize($mo->withoutRelations())); $this->skipbot = $skipbot; } diff --git a/app/Jobs/PacketProcess.php b/app/Jobs/PacketProcess.php index ab64e3e..59ca43b 100644 --- a/app/Jobs/PacketProcess.php +++ b/app/Jobs/PacketProcess.php @@ -35,7 +35,7 @@ class PacketProcess implements ShouldQueue public function __construct(string $filename,System $so,bool $interactive=TRUE,Carbon $rcvd_time=NULL,bool $nobot=FALSE) { $this->filename = $filename; - $this->so = $so; + $this->so = $so->withoutRelations(); $this->interactive = $interactive; $this->rcvd_time = $rcvd_time ?: Carbon::now(); $this->nobot = $nobot;