From 84e600fa521aa9f9597219e073bc9d84e3a0a794 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Wed, 27 May 2020 04:33:05 -0500 Subject: [PATCH] updates for job connections --- .../Commands/Data/CleanStaleDataCommand.php | 1 + .../Commands/Data/PurgeCorpMoonLedgers.php | 56 +++++++++++++++++++ .../Commands/Moons/MoonsUpdateCommand.php | 2 - .../Commands/Moons/FetchMoonLedgerJob.php | 4 ++ .../Commands/Moons/FetchMoonObserverJob.php | 4 ++ .../Moons/MoonRentalInvoiceCreate.php | 3 + .../Moons/MoonRentalInvoiceVerify.php | 3 +- app/Jobs/Commands/Moons/MoonRentalUpdate.php | 3 +- .../Commands/Moons/PurgeMoonLedgerJob.php | 5 +- .../GetPublicContractItemsJob.php | 4 ++ .../PublicContracts/GetPublicContractsJob.php | 3 + .../PublicContracts/PurgePublicContracts.php | 3 +- 12 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 app/Console/Commands/Data/PurgeCorpMoonLedgers.php diff --git a/app/Console/Commands/Data/CleanStaleDataCommand.php b/app/Console/Commands/Data/CleanStaleDataCommand.php index 19db72351..67b70a8c5 100644 --- a/app/Console/Commands/Data/CleanStaleDataCommand.php +++ b/app/Console/Commands/Data/CleanStaleDataCommand.php @@ -5,6 +5,7 @@ namespace App\Console\Commands\Data; //Internal Library use Illuminate\Console\Command; use Carbon\Carbon; +use Log; //Library use Commands\Library\CommandHelper; diff --git a/app/Console/Commands/Data/PurgeCorpMoonLedgers.php b/app/Console/Commands/Data/PurgeCorpMoonLedgers.php new file mode 100644 index 000000000..a6cd82a40 --- /dev/null +++ b/app/Console/Commands/Data/PurgeCorpMoonLedgers.php @@ -0,0 +1,56 @@ +SetStartStatus(); + + PurgeMoonLedgerJob::dispatch(); + + $task->SetStopStatus(); + } +} diff --git a/app/Console/Commands/Moons/MoonsUpdateCommand.php b/app/Console/Commands/Moons/MoonsUpdateCommand.php index 1a883b2a2..49a6c3ca1 100644 --- a/app/Console/Commands/Moons/MoonsUpdateCommand.php +++ b/app/Console/Commands/Moons/MoonsUpdateCommand.php @@ -84,8 +84,6 @@ class MoonsUpdateCommand extends Command FetchMoonLedgerJob::dispatch($charId); } - - //Set task done status $task->SetStopStatus(); } diff --git a/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php b/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php index b358b55fb..ca603db0a 100644 --- a/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php +++ b/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php @@ -51,7 +51,11 @@ class FetchMoonLedgerJob implements ShouldQueue */ public function __construct($charId) { + //Set the character id $this->charId = $charId; + + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/Moons/FetchMoonObserverJob.php b/app/Jobs/Commands/Moons/FetchMoonObserverJob.php index eb0adc0a5..4950442d2 100644 --- a/app/Jobs/Commands/Moons/FetchMoonObserverJob.php +++ b/app/Jobs/Commands/Moons/FetchMoonObserverJob.php @@ -49,7 +49,11 @@ class FetchMoonObserverJob implements ShouldQueue */ public function __construct($charId) { + //Set the character id $this->charId = $charId; + + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php b/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php index 5ae72447f..4006db994 100644 --- a/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php +++ b/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php @@ -92,6 +92,9 @@ class MoonRentalInvoiceCreate implements ShouldQueue //Null out unused variables when calling the construct $this->rentals = null; + + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php b/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php index 53713514a..07f3f55d8 100644 --- a/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php +++ b/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php @@ -43,7 +43,8 @@ class MoonRentalInvoiceVerify implements ShouldQueue */ public function __construct() { - // + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/Moons/MoonRentalUpdate.php b/app/Jobs/Commands/Moons/MoonRentalUpdate.php index e4f2d74c6..02a9b080e 100644 --- a/app/Jobs/Commands/Moons/MoonRentalUpdate.php +++ b/app/Jobs/Commands/Moons/MoonRentalUpdate.php @@ -19,7 +19,8 @@ class MoonRentalUpdate implements ShouldQueue */ public function __construct() { - // + //Setup the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php b/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php index 34ab8b6fa..167c6530b 100644 --- a/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php +++ b/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php @@ -12,7 +12,7 @@ use Log; use Carbon\Carbon; //App Models -use App\Models\CorpMoonLedger; +use App\Models\Moon\CorpMoonLedger; class PurgeMoonLedgerJob implements ShouldQueue { @@ -39,7 +39,8 @@ class PurgeMoonLedgerJob implements ShouldQueue */ public function __construct() { - // + //Set the connection for the job + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php b/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php index 43af17306..b7d4b1230 100644 --- a/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php +++ b/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php @@ -40,8 +40,12 @@ class GetPublicContractItemsJob implements ShouldQueue */ public function __construct($esi, $contract) { + //Setup the variables $this->esi = $esi; $this->contractId = $contract; + + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php b/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php index 33e58a55e..f9aee6d4c 100644 --- a/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php +++ b/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php @@ -44,6 +44,9 @@ class GetPublicContractsJob implements ShouldQueue } //Set the region code $this->region = $regionId; + + //Set the connection + $this->connection = 'redis'; } /** diff --git a/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php b/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php index 7b3b8031d..2d19d6f48 100644 --- a/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php +++ b/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php @@ -32,7 +32,8 @@ class PurgePublicContracts implements ShouldQueue */ public function __construct() { - //Nothing to do in this part of the job + //Set the connection + $this->connection = 'redis'; } /**