job for assets and structures modifications for how pages are called.

This commit is contained in:
2019-05-28 22:55:45 -05:00
parent f479a7066c
commit 38a30553b4
2 changed files with 4 additions and 13 deletions

View File

@@ -83,27 +83,20 @@ class GetAssets extends Command
$esi = new Eseye($authentication); $esi = new Eseye($authentication);
//Set the current page
$currentPage = 1;
//Set our default total pages, and we will refresh this later
$totalPages = 1;
try { try {
$assets = $esi->page($currentPage) $assets = $esi->invoke('get', '/corporations/{corporation_id}/assets/', [
->invoke('get', '/corporations/{corporation_id}/assets/', [
'corporation_id' => $corpId, 'corporation_id' => $corpId,
]); ]);
} catch (RequestFailedException $e) { } catch (RequestFailedException $e) {
// //
} }
$totalPages = $assets->pages; for($i = 1; $i <= $assets->pages; $i++) {
for($i = 1; $i <= $totalPages; $i++) {
$job = new JobProcessAsset; $job = new JobProcessAsset;
$job->charId = $charId; $job->charId = $charId;
$job->corpId = $corpId; $job->corpId = $corpId;
$job->page = $i; $job->page = $i;
$job->esi = $esi;
ProcessAssetJob::dispatch($job)->onQueue('default'); ProcessAssetJob::dispatch($job)->onQueue('default');
} }
} }

View File

@@ -98,9 +98,7 @@ class GetStructures extends Command
return null; return null;
} }
$totalPages = $structures->pages; for($i = 1; $i <= $structures->pages; $i++) {
for($i = 1; $i <= $totalPages; $i++) {
$job = new JobProcessStructure; $job = new JobProcessStructure;
$job->charId = $charId; $job->charId = $charId;
$job->corpId = $corpId; $job->corpId = $corpId;