clrghouz/app/Jobs/AddressIdleDomain.php

28 lines
629 B
PHP
Raw Normal View History

<?php
namespace App\Jobs;
2024-12-08 10:38:10 +00:00
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Models\Domain;
class AddressIdleDomain implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Execute the job.
*/
public function handle(): void
{
2024-12-08 10:38:10 +00:00
foreach (Domain::whereNotNull('nodestatus_id')->cursor() as $do) {
AddressIdle::dispatch($do);
2024-12-08 10:38:10 +00:00
NodesNew::dispatch($do,Carbon::now()->subWeek()->startOfDay());
}
}
}