job stuff
This commit is contained in:
@@ -58,6 +58,7 @@ class Test extends Command
|
|||||||
|
|
||||||
//Get the ESI Token
|
//Get the ESI Token
|
||||||
$token = $esiHelper->GetRefreshToken($config['primary']);
|
$token = $esiHelper->GetRefreshToken($config['primary']);
|
||||||
|
dd($token);
|
||||||
$esi = $esiHelper->SetupEsiAuthentication($token);
|
$esi = $esiHelper->SetupEsiAuthentication($token);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -48,20 +48,8 @@ class HoldingFinancesCommand extends Command
|
|||||||
//Get the esi configuration
|
//Get the esi configuration
|
||||||
$config = config('esi');
|
$config = config('esi');
|
||||||
|
|
||||||
//Get the total pages for the journal for the holding corporation
|
for($i = 1; $i <= 6; $i++) {
|
||||||
$pages = $finance->GetJournalPageCount(1, $config['primary']);
|
ProcessWalletJournalJob::dispatch($i, $config['primary'])->onQueue('journal');
|
||||||
|
|
||||||
//Dispatch a single job for each page to process
|
|
||||||
for($i = 1; $i <= $pages; $i++) {
|
|
||||||
ProcessWalletJournalJob::dispatch(1, $config['primary'], $i)->onQueue('journal');
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get the total pages for the journal for the sov bills from the holding corporation
|
|
||||||
$pages = $finance->GetJournalPageCount(6, $config['primary']);
|
|
||||||
|
|
||||||
//Dispatch a job for each page to process
|
|
||||||
for($i = 1; $i <= $pages; $i++) {
|
|
||||||
ProcessWalletJournalJob::dispatch(6, $config['primary'], $i)->onQueue('journal');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,9 @@ class ProcessWalletJournalJob implements ShouldQueue
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct($division, $charId, $page) {
|
public function __construct($division, $charId) {
|
||||||
$this->division = $division;
|
$this->division = $division;
|
||||||
$this->charId = $charId;
|
$this->charId = $charId;
|
||||||
$this->page = $page;
|
|
||||||
|
|
||||||
$this->connection = 'redis';
|
$this->connection = 'redis';
|
||||||
}
|
}
|
||||||
@@ -61,7 +60,7 @@ class ProcessWalletJournalJob implements ShouldQueue
|
|||||||
//Declare the class variable we need
|
//Declare the class variable we need
|
||||||
$finance = new FinanceHelper();
|
$finance = new FinanceHelper();
|
||||||
|
|
||||||
$finance->GetWalletJournalPage($this->division, $this->charId, $this->page);
|
$finance->GetWalletJournal($this->division, $this->charId);
|
||||||
|
|
||||||
//After the job is completed, delete the job
|
//After the job is completed, delete the job
|
||||||
$this->delete();
|
$this->delete();
|
||||||
|
|||||||
@@ -59,16 +59,13 @@ class FinanceHelper {
|
|||||||
if($token == null) {
|
if($token == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
//Create an ESI authentication container
|
||||||
|
$esi = $esiHelper->SetupEsiAuthentication($token);
|
||||||
|
|
||||||
//Reference to see if the character is in our look up table for corporations and characters
|
//Reference to see if the character is in our look up table for corporations and characters
|
||||||
$char = $lookup->GetCharacterInfo($charId);
|
$char = $lookup->GetCharacterInfo($charId);
|
||||||
$corpId = $char->corporation_id;
|
$corpId = $char->corporation_id;
|
||||||
|
|
||||||
//Create an ESI authentication container
|
|
||||||
$esi = $esiHelper->SetupEsiAuthentication($token);
|
|
||||||
//Set the version
|
|
||||||
$esi->setVersion('v4');
|
|
||||||
|
|
||||||
//Set caching to null
|
//Set caching to null
|
||||||
$configuration = Configuration::getInstance();
|
$configuration = Configuration::getInstance();
|
||||||
$configuration->cache = NullCache::class;
|
$configuration->cache = NullCache::class;
|
||||||
|
|||||||
Reference in New Issue
Block a user