removed command helper junk
This commit is contained in:
@@ -7,9 +7,6 @@ use Illuminate\Console\Command;
|
||||
use Carbon\Carbon;
|
||||
use Log;
|
||||
|
||||
//Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\Lookups\AllianceLookup;
|
||||
use App\Models\Lookups\CharacterLookup;
|
||||
@@ -57,9 +54,6 @@ class CleanStaleDataCommand extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$command = new CommandHelper;
|
||||
$command->CleanJobStatusTable();
|
||||
|
||||
//Empty the item lookup table
|
||||
ItemLookup::truncate();
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use Illuminate\Console\Command;
|
||||
|
||||
//Library
|
||||
use App\Library\Moons\MoonCalc;
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Job
|
||||
use App\Jobs\Commands\Eve\ItemPricesUpdateJob;
|
||||
@@ -46,17 +45,10 @@ class ItemPricesUpdateCommand extends Command
|
||||
{
|
||||
//Declare variables
|
||||
$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
|
||||
$moonHelper->FetchNewPrices();
|
||||
|
||||
//Set the task as completed
|
||||
$task->SetStopStatus();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ use Carbon\Carbon;
|
||||
|
||||
//Application Library
|
||||
use App\Library\Helpers\FinanceHelper;
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Jobs
|
||||
use App\Jobs\Commands\Finances\UpdateAllianceWalletJournalJob;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -12,7 +12,6 @@ use Carbon\Carbon;
|
||||
|
||||
//Application Library
|
||||
use App\Library\Helpers\FinanceHelper;
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\Finances\AllianceWalletJournal;
|
||||
|
||||
@@ -10,9 +10,6 @@ use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
use Carbon\Carbon;
|
||||
|
||||
//Application Library
|
||||
use Commands\Library\CommandHelper;
|
||||
|
||||
//Models
|
||||
use App\Models\MiningTax\Observer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user