job updates and command kernel updates

This commit is contained in:
2021-06-07 03:30:23 +09:00
parent 82072f18dc
commit 2a3a86f185
9 changed files with 16 additions and 77 deletions

View File

@@ -4,7 +4,7 @@ namespace App\Console\Commands\MiningTaxes;
use Illuminate\Console\Command;
use App\Jobs\Commands\MiningTaxes\PreFetchMiningTaxesLedgers as PreFetch;
use App\Jobs\Commands\MiningTaxes\Ledgers\PreFetchMiningTaxesLedgers as PreFetch;
class ExecuteMiningTaxesLedgersCommand extends Command
{
@@ -39,7 +39,7 @@ class ExecuteMiningTaxesLedgersCommand extends Command
*/
public function handle()
{
PreFetch::dispatch()->onQueue('miningtaxes');
PreFetch::dispatch();
return 0;
}

View File

@@ -39,7 +39,7 @@ class ExecuteMiningTaxesObserversCommand extends Command
*/
public function handle()
{
FetchObservers::dispatch()->onQueue('miningtaxes');
FetchObservers::dispatch();
return 0;
}

View File

@@ -39,7 +39,7 @@ class ExecuteProcesssMiningTaxesPaymentsCommand extends Command
*/
public function handle()
{
PMTP::dispatch()->onQueue('miningtaxes');
PMTP::dispatch();
return 0;
}

View File

@@ -4,7 +4,7 @@ namespace App\Console\Commands\MiningTaxes;
use Illuminate\Console\Command;
use App\Jobs\Commands\MiningTaxes\SendMiningTaxesInvoices as SendInvoice;
use App\Jobs\Commands\MiningTaxes\Invoices\SendMiningTaxesInvoices as SendInvoice;
class ExecuteSendMiningTaxesInvoiceCommand extends Command
{
@@ -39,7 +39,7 @@ class ExecuteSendMiningTaxesInvoiceCommand extends Command
*/
public function handle()
{
SendInvoice::dispatch()->onQueue('miningtaxes');
SendInvoice::dispatch();
return 0;
}

View File

@@ -22,6 +22,7 @@ use App\Jobs\Commands\Structures\FetchAllianceStructures;
use App\Jobs\Commands\Structures\PurgeAllianceStructures;
use App\Jobs\Commands\Assets\FetchAllianceAssets;
use App\Jobs\Commands\Assets\PurgeAllianceAssets;
use App\Jobs\Commands\MoonRental\UpdateAllianceMoonRentalWorth;
class Kernel extends ConsoleKernel
{
@@ -107,6 +108,9 @@ class Kernel extends ConsoleKernel
$schedule->job(new UpdateMiningTaxesLateInvoices15th)
->monthlyOn(15, '16:00')
->withoutOverlapping();
$schedule->job(new UpdateAllianceMoonRentalWorth)
->dailyAt('13:00')
->withoutOverlapping();
/**
* Alliance Structure and Assets Schedule

View File

@@ -1,65 +0,0 @@
<?php
namespace App\Jobs\Commands\MiningTaxes;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Log;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
//Application Library
use App\Library\Helpers\LookupHelper;
//Models
use App\Models\MiningTax\Invoice;
class CreateMiningTaxesInvoice implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Timeout in seconds
*
* @var int
*/
public $timeout = 3600;
/**
* Number of job retries
*
* @var int
*/
public $tries = 3;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
$this->connection = 'redis';
$this->onQueue('miningtaxes');
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//Declare variables
$lookup = new LookupHelper;
$mainAlts = array();
$mainIds = new Collection;
//Get all of the users in the database
$characters = User::all();
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Jobs\Commands\MiningTaxes;
namespace App\Jobs\Commands\MiningTaxes\Ledgers;
//Internal Library
use Illuminate\Bus\Queueable;
@@ -17,7 +17,7 @@ use App\Library\Helpers\LookupHelper;
use App\Library\Moons\MoonCalc;
//Jobs
use App\Jobs\Commands\MiningTaxes\ProcessMiningTaxesLedgers;
use App\Jobs\Commands\MiningTaxes\Ledgers\ProcessMiningTaxesLedgers;
//App Models
use App\Models\MiningTax\Observer;
@@ -143,7 +143,7 @@ class FetchMiningTaxesLedgers implements ShouldQueue
//Dispatch jobs to process each of the mining ledger entries
foreach($ledgers as $ledger) {
ProcessMiningTaxesLedgers::dispatch($ledger, $this->observerId)->onQueue('miningtaxes');
ProcessMiningTaxesLedgers::dispatch($ledger, $this->observerId);
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Jobs\Commands\MiningTaxes;
namespace App\Jobs\Commands\MiningTaxes\Ledgers;
//Internal Library
use Illuminate\Bus\Queueable;

View File

@@ -14,7 +14,7 @@ use Carbon\Carbon;
use App\Models\MiningTax\Observer;
//Jobs
use App\Jobs\Commands\MiningTaxes\FetchMiningTaxesLedgers;
use App\Jobs\Commands\MiningTaxes\Ledgers\FetchMiningTaxesLedgers;
class PreFetchMiningTaxesLedgers implements ShouldQueue
{
@@ -60,7 +60,7 @@ class PreFetchMiningTaxesLedgers implements ShouldQueue
//For each of the observers, send a job to fetch the mining ledger
foreach($observers as $obs) {
//Dispatch the mining taxes ledger jobs
FetchMiningTaxesLedgers::dispatch($config['primary'], $config['corporation'], $obs->observer_id)->onQueue('miningtaxes');
FetchMiningTaxesLedgers::dispatch($config['primary'], $config['corporation'], $obs->observer_id);
}
}