job stuff

This commit is contained in:
2021-02-14 00:46:15 +09:00
parent 4da6e98c49
commit 925b9739da
4 changed files with 8 additions and 23 deletions

View File

@@ -58,6 +58,7 @@ class Test extends Command
//Get the ESI Token
$token = $esiHelper->GetRefreshToken($config['primary']);
dd($token);
$esi = $esiHelper->SetupEsiAuthentication($token);
try {

View File

@@ -48,20 +48,8 @@ class HoldingFinancesCommand extends Command
//Get the esi configuration
$config = config('esi');
//Get the total pages for the journal for the holding corporation
$pages = $finance->GetJournalPageCount(1, $config['primary']);
//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');
for($i = 1; $i <= 6; $i++) {
ProcessWalletJournalJob::dispatch($i, $config['primary'])->onQueue('journal');
}
}
}

View File

@@ -40,10 +40,9 @@ class ProcessWalletJournalJob implements ShouldQueue
*
* @return void
*/
public function __construct($division, $charId, $page) {
public function __construct($division, $charId) {
$this->division = $division;
$this->charId = $charId;
$this->page = $page;
$this->connection = 'redis';
}
@@ -61,7 +60,7 @@ class ProcessWalletJournalJob implements ShouldQueue
//Declare the class variable we need
$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
$this->delete();

View File

@@ -58,17 +58,14 @@ class FinanceHelper {
$token = $esiHelper->GetRefreshToken($charId);
if($token == 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
$char = $lookup->GetCharacterInfo($charId);
$corpId = $char->corporation_id;
//Create an ESI authentication container
$esi = $esiHelper->SetupEsiAuthentication($token);
//Set the version
$esi->setVersion('v4');
//Set caching to null
$configuration = Configuration::getInstance();
$configuration->cache = NullCache::class;