removed command helper junk

This commit is contained in:
2021-05-18 20:48:12 +09:00
parent 0093b8d841
commit 8c580827b4
6 changed files with 0 additions and 67 deletions

View File

@@ -7,9 +7,6 @@ use Illuminate\Console\Command;
use Carbon\Carbon; use Carbon\Carbon;
use Log; use Log;
//Library
use Commands\Library\CommandHelper;
//Models //Models
use App\Models\Lookups\AllianceLookup; use App\Models\Lookups\AllianceLookup;
use App\Models\Lookups\CharacterLookup; use App\Models\Lookups\CharacterLookup;
@@ -57,9 +54,6 @@ class CleanStaleDataCommand extends Command
*/ */
public function handle() public function handle()
{ {
$command = new CommandHelper;
$command->CleanJobStatusTable();
//Empty the item lookup table //Empty the item lookup table
ItemLookup::truncate(); ItemLookup::truncate();

View File

@@ -6,7 +6,6 @@ use Illuminate\Console\Command;
//Library //Library
use App\Library\Moons\MoonCalc; use App\Library\Moons\MoonCalc;
use Commands\Library\CommandHelper;
//Job //Job
use App\Jobs\Commands\Eve\ItemPricesUpdateJob; use App\Jobs\Commands\Eve\ItemPricesUpdateJob;
@@ -46,17 +45,10 @@ class ItemPricesUpdateCommand extends Command
{ {
//Declare variables //Declare variables
$moonHelper = new MoonCalc; $moonHelper = new MoonCalc;
$task = new CommandHelper('ItemPricesUpdateCommand');
//Set the task as started
$task->SetStartStatus();
//Fetch new prices from fuzzwork.co.uk for the item pricing schemes //Fetch new prices from fuzzwork.co.uk for the item pricing schemes
$moonHelper->FetchNewPrices(); $moonHelper->FetchNewPrices();
//Set the task as completed
$task->SetStopStatus();
return 0; return 0;
} }
} }

View File

@@ -9,7 +9,6 @@ use Carbon\Carbon;
//Application Library //Application Library
use App\Library\Helpers\FinanceHelper; use App\Library\Helpers\FinanceHelper;
use Commands\Library\CommandHelper;
//Jobs //Jobs
use App\Jobs\Commands\Finances\UpdateAllianceWalletJournalJob; use App\Jobs\Commands\Finances\UpdateAllianceWalletJournalJob;

View File

@@ -1,48 +0,0 @@
<?php
namespace Commands\Library;
//Internal Libraries
use Carbon\Carbon;
//Models
use App\Models\ScheduledTask\ScheduleJob;
class CommandHelper {
private $job_name;
private $job_state;
private $system_time;
public function __construct($name) {
$this->job_name = $name;
$this->job_state = 'Starting';
$this->system_time = Carbon::now();
}
public function SetStartStatus() {
//Add an entry into the jobs table
$job = new ScheduleJob;
$job->job_name = $this->job_name;
$job->job_state = $this->job_state;
$job->system_time = $this->system_time;
$job->save();
}
public function SetStopStatus() {
//Mark the job as finished
ScheduleJob::where([
'system_time' => $this->system_time,
'job_name' => $this->job_name,
])->update([
'job_state' => 'Finished',
]);
}
public function CleanJobStatusTable() {
//Delete old jobs
ScheduleJob::where(['system_time', '<', Carbon::now()->subMonths(3)])->delete();
}
}
?>

View File

@@ -12,7 +12,6 @@ use Carbon\Carbon;
//Application Library //Application Library
use App\Library\Helpers\FinanceHelper; use App\Library\Helpers\FinanceHelper;
use Commands\Library\CommandHelper;
//Models //Models
use App\Models\Finances\AllianceWalletJournal; use App\Models\Finances\AllianceWalletJournal;

View File

@@ -10,9 +10,6 @@ use Illuminate\Queue\SerializesModels;
use Log; use Log;
use Carbon\Carbon; use Carbon\Carbon;
//Application Library
use Commands\Library\CommandHelper;
//Models //Models
use App\Models\MiningTax\Observer; use App\Models\MiningTax\Observer;