find($this->companyId); if (!$company || $company->machines->isEmpty()) { return; } $delayMs = 100; // 100ms per machine foreach ($company->machines as $index => $machine) { // Calculate delay to avoid thundering herd (100ms, 200ms, 300ms...) $currentDelay = ($index * $delayMs) / 1000; SendProductSyncCommandJob::dispatch($machine->id, $this->remark, $this->userId) ->delay(now()->addSeconds($currentDelay)); } } }