diff --git a/app/Jobs/Host/DispatchHostCostQueueJob.php b/app/Jobs/Host/DispatchHostCostQueueJob.php index 04bfc63..dbd837a 100644 --- a/app/Jobs/Host/DispatchHostCostQueueJob.php +++ b/app/Jobs/Host/DispatchHostCostQueueJob.php @@ -36,14 +36,14 @@ public function __construct($minute, Host $host = null) */ public function handle(): void { - if (! $this->host) { + if (!$this->host) { $host = new Host(); if (app()->environment() != 'local') { $host = $host->where('minute_at', $this->minute); } - $host->whereIn('status', ['running', 'stopped'])->with('user')->chunk(500, function ($hosts) { + $host->whereIn('status', ['running', 'stopped'])->whereNull('billing_cycle')->with('user')->chunk(500, function ($hosts) { foreach ($hosts as $host) { dispatch(new self($this->minute, $host)); }