From 098c1585a1069693e0ff729903ae20fa58bfe049 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 5 Jul 2019 01:39:38 -0500 Subject: [PATCH] asset job --- app/Console/Commands/Assets/GetAssets.php | 15 +-------------- app/Jobs/ProcessAssetsJob.php | 8 ++++++-- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/Console/Commands/Assets/GetAssets.php b/app/Console/Commands/Assets/GetAssets.php index c6c24e33e..dfb9f01cc 100644 --- a/app/Console/Commands/Assets/GetAssets.php +++ b/app/Console/Commands/Assets/GetAssets.php @@ -109,7 +109,7 @@ class GetAssetsCommand extends Command } $pages = $assets->pages; - /* + for($i = 1; $i < $pages; $i++) { $job = new JobProcessAsset; $job->charId = $charId; @@ -117,18 +117,5 @@ class GetAssetsCommand extends Command $job->page = $i; ProcessAssetsJob::dispatch($job)->onQueue('assets'); } - */ - for($i = 1; $i < $pages; $i++) { - $currentPage = $i; - - $aHelper = new AssetHelper($charId, $corpId, $currentPage); - - //Get a page of assets - $assets = $aHelper->GetAssetsByPage(); - - foreach($assets as $asset) { - $aHelper->StoreNewAsset($asset); - } - } } } diff --git a/app/Jobs/ProcessAssetsJob.php b/app/Jobs/ProcessAssetsJob.php index f16072153..f663f47e0 100644 --- a/app/Jobs/ProcessAssetsJob.php +++ b/app/Jobs/ProcessAssetsJob.php @@ -93,8 +93,12 @@ class ProcessAssetsJob implements ShouldQueue //Cycle through the assets, and attmept to store them. foreach($assets as $asset) { - //Attempt to store the asset - $aHelper->StoreNewAsset($asset); + //If the asset is in one of the locations we want, then store + //or update the asset + if(in_array($asset->location_flag, $this->location_array)) { + //Attempt to store the asset + $aHelper->StoreNewAsset($asset); + } } //Purge Stale Data