Пример #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     set_time_limit(0);
     $container = $this->getContainer();
     /* @var $resque \Zym\Bundle\ResqueBundle\Resque */
     $resque = $container->get('zym_resque.resque');
     for ($x = 0; $x < Redis::count(); $x++) {
         Redis::requeue($x);
     }
 }
Пример #2
0
 /**
  * @Route(
  *     ".{_format}", 
  *     name="zym_resque_failures",
  *     defaults={
  *         "_format" = "html"
  *     }
  * )
  * @Template()
  */
 public function indexAction()
 {
     /* @var $request \Symfony\Component\HttpFoundation\Request */
     $request = $this->get('request');
     $page = $request->query->get('page', 1);
     $limit = $request->query->get('limit', 50);
     $orderBy = $request->query->get('orderBy');
     $filterBy = $request->query->get('filterBy');
     $resque = $this->get('zym_resque.resque');
     //$resque->enqueue(new \Zym\Bundle\ResqueBundle\Tests\ExceptionJob());
     $start = FailedJobs::count() - $page * $limit;
     $failures = array_reverse(FailedJobs::all($start < 0 ? 0 : $start, $start < 0 ? $limit - abs($start) : $limit));
     return array('resque' => $resque, 'failures' => $failures, 'page' => (int) $page, 'limit' => (int) $limit, 'count' => FailedJobs::count());
 }