diff --git a/app/Console/Commands/Logistics/GetEveContracts.php b/app/Console/Commands/Logistics/GetEveContracts.php deleted file mode 100644 index ebe7b21ba..000000000 --- a/app/Console/Commands/Logistics/GetEveContracts.php +++ /dev/null @@ -1,122 +0,0 @@ -SetStartStatus(); - - //Setup the esi authentication container - $config = config('esi'); - - //Declare some variables - $charId = 2115439862; - $corpId = 98606886; - - //Esi Scope Check - $esiHelper = new Esi(); - $contractScope = $esiHelper->HaveEsiScope($charId, 'esi-contracts.read_corporation_contracts.v1'); - - if($contractScope == false) { - Log::critical('Scope check for esi-contracts.read_corporation_contracts.v1 failed.'); - return null; - } - - // Disable all caching by setting the NullCache as the - // preferred cache handler. By default, Eseye will use the - // FileCache. - $configuration = Configuration::getInstance(); - $configuration->cache = NullCache::class; - - //Get the refresh token from the database - $token = EsiToken::where(['character_id' => $charId])->get(['refresh_token']); - //Create the authentication container - $authentication = new EsiAuthentication([ - 'client_id' => $config['client_id'], - 'secret' => $config['secret'], - 'refresh_token' => $token[0]->refresh_token, - ]); - - $esi = new Eseye($authentication); - - try { - $contracts = $esi->page(1) - ->invoke('get', '/corporations/{corporation_id}/contracts/', [ - 'corporation_id' => $corpId, - ]); - } catch (RequestFailedException $e) { - Log::critical("Failed to get the contracts list."); - return null; - } - - $pages = $contracts->pages; - - for($i = 1; $i <= $pages; $i++) { - $job = new JobProcessEveContracts; - $job->charId = $charId; - $job->corpId = $corpId; - $job->page = $i; - ProcessEveContractsJob::dispatch($job)->onQueue('default'); - } - - //Mark the job as finished - $task->SetStopStatus(); - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index dc96b8663..568dae49f 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -23,7 +23,6 @@ class Kernel extends ConsoleKernel Commands\MoonMailerCommand::class, Commands\GetStructuresCommand::class, Commands\GetAssetsCommand::class, - Commands\GetEveContractsCommand::class, Commands\PurgeUsers::class, ]; diff --git a/app/Jobs/ProcessEveContractsJob.php b/app/Jobs/ProcessEveContractsJob.php deleted file mode 100644 index 802bf0ced..000000000 --- a/app/Jobs/ProcessEveContractsJob.php +++ /dev/null @@ -1,76 +0,0 @@ -charId = $jpc->charId; - $this->corpId = $jpc->corpId; - $this->page = $jpc->page; - - //Set the connection for the job - $this->connection = 'redis'; - } - - /** - * Execute the job. - * - * @return void - */ - public function handle() - { - //Declare the contracts helper - $cHelper = new EveContractsHelper($this->charId, $this->corpId, $this->page); - - $contracts = $cHelper->GetContractsByPage(); - - foreach($contracts as $contract) { - $cHelper->ProcessContract($contract); - } - - //After the job is completed, delete the job - $this->delete(); - } -} diff --git a/app/Models/Jobs/JobProcessEveContracts.php b/app/Models/Jobs/JobProcessEveContracts.php deleted file mode 100644 index 4b7840d61..000000000 --- a/app/Models/Jobs/JobProcessEveContracts.php +++ /dev/null @@ -1,19 +0,0 @@ -