Ensure our jobs are storing objects without relations

This commit is contained in:
Deon George 2024-11-03 00:16:48 +11:00
parent 3b7ce4b9ce
commit f03533b62a
7 changed files with 8 additions and 15 deletions

View File

@ -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();
}
/**

View File

@ -14,13 +14,6 @@ class AddressIdleDomain implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct()
{
}
/**
* Execute the job.
*/

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;