From b20bde1f565d4811a3841ee194bdc798a5beaa95 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 13 May 2019 23:26:33 -0500 Subject: [PATCH] job library --- app/Jobs/Library/JobHelper.php | 40 ------------------------ app/Jobs/ProcessWalletJournalJob.php | 5 --- app/Jobs/ProcessWallettransactionJob.php | 5 --- app/Jobs/SendEveMailJob.php | 9 +----- 4 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 app/Jobs/Library/JobHelper.php diff --git a/app/Jobs/Library/JobHelper.php b/app/Jobs/Library/JobHelper.php deleted file mode 100644 index 64bb4a2d7..000000000 --- a/app/Jobs/Library/JobHelper.php +++ /dev/null @@ -1,40 +0,0 @@ -job_name = $name; - $this->complete = false; - $this->system_time = Carbon::now(); - } - - public function SetStartStatus() { - $this->jobStatus = new JobStatus; - $this->jobStatus->job_name = $this->job_name; - $this->jobStatus->complete = $this->complete; - $this->jobStatus->system_time = $this->system_time; - } - - public function SetStopStatus() { - $this->jobStatus::update([ - 'complete' => true, - ]); - } - - public function CleeanJobStatusTable() { - DB::table('job_statuses')->where('system_time', '<', Carbon::now()->subMonths(3))->delete(); - } -} \ No newline at end of file diff --git a/app/Jobs/ProcessWalletJournalJob.php b/app/Jobs/ProcessWalletJournalJob.php index 55b54a81e..fa72ad803 100644 --- a/app/Jobs/ProcessWalletJournalJob.php +++ b/app/Jobs/ProcessWalletJournalJob.php @@ -58,16 +58,11 @@ class ProcessWalletJournalJob implements ShouldQueue */ public function handle() { - $status = new JobHelper('Process Wallet Journal'); - $status->SetStartStatus(); - //Declare the class variable we need $finance = new FinanceHelper(); $finance->GetWalletJournalPage($this->division, $this->charId, $this->page); - $status->SetStopStatus(); - //After the job is completed, delete the job $this->delete(); } diff --git a/app/Jobs/ProcessWallettransactionJob.php b/app/Jobs/ProcessWallettransactionJob.php index bf2b8800c..c95586bdb 100644 --- a/app/Jobs/ProcessWallettransactionJob.php +++ b/app/Jobs/ProcessWallettransactionJob.php @@ -54,16 +54,11 @@ class ProcessWalletTransactionJob implements ShouldQueue */ public function handle() { - $status = new JobHelper('Process Wallet Transaction'); - $status->SetStartStatus(); - //Declare the class variables $finance = new FinanceHelper(); $finance->GetWalletTransaction($this->division, $this->charId); - $status->SetStopStatus(); - //After the job is completed, delete the job $this->delete(); } diff --git a/app/Jobs/SendEveMailJob.php b/app/Jobs/SendEveMailJob.php index 24a0efca7..a8af3baca 100644 --- a/app/Jobs/SendEveMailJob.php +++ b/app/Jobs/SendEveMailJob.php @@ -15,8 +15,6 @@ use Seat\Eseye\Containers\EsiAuthentication; use Seat\Eseye\Eseye; use Seat\Eseye\Exceptions\RequestFailedException; -use App\Jobs\Library\JobHelper; - //Models use App\Models\Esi\EsiScope; use App\Models\Esi\EsiToken; @@ -71,9 +69,6 @@ class SendEveMailJob implements ShouldQueue */ public function handle() { - $status = new JobHelper('Send EveMail'); - $status->SetStartStatus(); - //Retrieve the token for main character to send mails from $token = EsiToken::where(['character_id'=> 93738489])->get(); @@ -104,9 +99,7 @@ class SendEveMailJob implements ShouldQueue } catch(RequestFailedException $e) { return null; } - - $status->SetStopStatus(); - + $this->delete(); }