getTaskLog(); $broker = $this->getQueueDispatcher() ->getQueue($stuckTask->getQueueName()) ->getBroker(); if (!$broker instanceof RdsQueueBroker) { throw new InvalidArgumentException( sprintf( 'Broker %s for queue %s is not supported. Supported only %s', $broker->getBrokerId(), $stuckTask->getQueueName(), RdsQueueBroker::class ) ); } if ($stuckTask->isOrphan()) { $callback = $taskLogEntity->getTaskName(); $this->getTaskLog()->getBroker()->updateStatus( $taskLogEntity->getId(), TaskLogInterface::STATUS_CANCELLED ); $this->getQueueDispatcher()->createTask( new $callback(), $taskLogEntity->getParameters(), $taskLogEntity->getLabel() ); return; } $broker->changeTaskVisibility($stuckTask->getTaskId(), true); $this->getTaskLog()->setStatus($stuckTask->getTaskId(), TaskLogInterface::STATUS_ENQUEUED); } private function getTaskLog(): TaskLogInterface { return $this->getServiceLocator()->get(TaskLogInterface::SERVICE_ID); } private function getQueueDispatcher(): QueueDispatcherInterface { return $this->getServiceLocator()->get(QueueDispatcherInterface::SERVICE_ID); } }