jobList = $jobList; $this->service = $service; $this->api = $api; $this->setInterval(15 * 60); } protected function run($argument) { try { $room = $this->service->find($argument['id']); } catch (RoomNotFound $e) { $this->jobList->remove($this, $argument); return; } if (!$room->running) { $this->jobList->remove($this, $argument); return; } $isRunning = $this->api->isRunning($room); if (!$isRunning) { $this->service->updateRunning($room->id, $isRunning); $this->jobList->remove($this, $argument); } } }