src/AppBundle/Controller/Admin/QueueController.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace AppBundle\Controller\Admin;

use AppBundle\Common\Paginator;
use Codeages\Biz\Framework\Queue\Service\QueueService;
use Symfony\Component\HttpFoundation\Request;

class QueueController extends BaseController
{
    public function failedJobsAction(Request $request)
    {
        $count = $this->getQueueService()->countFailedJobs(array());

        $paginator = new Paginator(
            $request,
            $count,
            20
        );

        $jobs = $this->getQueueService()->searchFailedJobs(
            array(),
            array('failed_time' => 'desc'),
            $paginator->getOffsetCount(),
            $paginator->getPerPageCount()
        );

        return $this->render(
            'admin/queue/failed-logs.html.twig',
            array(
                'jobs' => $jobs,
                'paginator' => $paginator,
            )
        );
    }

    public function failedJobAction(Request $request, $id)
    {
        $failedJob = $this->getQueueService()->getFailedJob($id);

        return $this->render(
            'admin/queue/failed-log-modal.html.twig',
            array(
                'failedJob' => $failedJob,
            )
        );
    }

    /**
     * @return QueueService
     */
    protected function getQueueService()
    {
        return $this->createService('Queue:QueueService');
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。