diff --git a/app/Console/Commands/GetStructures.php b/app/Console/Commands/GetStructures.php index c3458a3ee..994bad50c 100644 --- a/app/Console/Commands/GetStructures.php +++ b/app/Console/Commands/GetStructures.php @@ -111,7 +111,6 @@ class GetStructuresCommand extends Command $job->charId = $charId; $job->corpId = $corpId; $job->page = $i; - $job->esi = $esi; ProcessStructureJob::dispatch($job)->onQueue('default'); } diff --git a/app/Jobs/ProcessStructureJob.php b/app/Jobs/ProcessStructureJob.php index b1d0315fc..06139d563 100644 --- a/app/Jobs/ProcessStructureJob.php +++ b/app/Jobs/ProcessStructureJob.php @@ -52,7 +52,18 @@ class ProcessStructureJob implements ShouldQueue $this->charId = $jps->charId; $this->corpId = $jps->corpId; $this->page = $jps->page; - $this->esi = $jps->esi; + + //Setup the esi authentication container + $config = config('esi'); + //Get the refresh token from the database + $token = EsiToken::where(['character_id' => $charId])->get(['refresh_token']); + $authentication = new EsiAuthentication([ + 'client_id' => $config['client_id'], + 'secret' => $config['secret'], + 'refresh_token' => $token[0]->refresh_token, + ]); + + $this->esi = new Eseye($authentication); //Set the connection for the job $this->connection = 'redis'; diff --git a/app/Models/Jobs/JobProcessStructure.php b/app/Models/Jobs/JobProcessStructure.php index f2b87c60f..1d0cfc326 100644 --- a/app/Models/Jobs/JobProcessStructure.php +++ b/app/Models/Jobs/JobProcessStructure.php @@ -21,6 +21,5 @@ class JobProcessStructure extends Model 'charId', 'corpId', 'page', - 'esi', ]; }