added queue to horizon schedule in the kernel for console commands and scheduler

This commit is contained in:
2021-05-19 00:46:22 +09:00
parent c089beae10
commit e949b1d717
5 changed files with 37 additions and 29 deletions

View File

@@ -57,7 +57,11 @@ class ProcessAllianceAssets implements ShouldQueue
* If the asset is not in the database, then let's save it to the database,
* otherwise, we just update the old asset
*/
if(Asset::where(['item_id' => $this->asset->item_id])->count() == 0) {
$count = Asset::where([
'item_id' => $this->asset->item_id,
])->count();
if($count == 0) {
$as = new Asset;
if(isset($this->asset->is_blueprint_copy)) {
$as->is_blueprint_copy = $this->asset->is_blueprint_copy;

View File

@@ -13,9 +13,6 @@ use Illuminate\Queue\SerializesModels;
use App\Library\Helpers\LookupHelper;
use App\Library\Esi\Esi;
//Jobs
use App\Jobs\Commands\Structures\ProcessAllianceStructureServices;
//Models
use App\Models\Structure\Structure;
use App\Models\Structure\Service;
@@ -98,6 +95,12 @@ class ProcessAllianceStructures implements ShouldQueue
$s->corporation_id = $structure->corporation_id;
if(isset($structure->services)) {
$s->services = true;
foreach($structure->services as $service) {
$serv = new Service;
$serv->structure_id = $structure->structure_id;
$serv->name = $service->name;
$serv->state = $service->state;
}
} else {
$s->services = false;
}
@@ -123,16 +126,6 @@ class ProcessAllianceStructures implements ShouldQueue
$s->unanchors_at = $esiHelper->DecodeDate($s->unanchors_at);
}
$s->save();
//If there are services on the structure, then save the service and the structure id in the database table.
if($s->services == true) {
foreach($structure->services as $service) {
$serv = new Service;
$serv->structure_id = $structure->structure_id;
$serv->name = $service->name;
$serv->state = $service->state;
}
}
}
private function UpdateStructure($structure) {