Exemplo n.º 1
0
 public function perform()
 {
     printf("Starting movie %s\n", $this->args['movieId']);
     // Build movie
     try {
         $movie = new Movie_HelioviewerMovie($this->args['movieId']);
         $movie->build();
     } catch (Exception $e) {
         // Handle any errors encountered
         printf("Error processing movie %s\n", $this->args['movieId']);
         logErrorMsg($e->getMessage(), "Resque_");
         // If counter was increased at queue time, decrement
         $this->_updateCounter();
         throw $e;
     }
     printf("Finished movie %s\n", $this->args['movieId']);
     $this->_updateCounter();
     // If the queue is empty and no jobs are being processed, set estimated
     // time counter to zero
     //$numWorking = sizeOf($redis->keys("resque:worker:*".HV_MOVIE_QUEUE));
     //$queueSize  = $redis->llen("resque:queue:".HV_MOVIE_QUEUE);
     //if ($numWorking <= 1 && $queueSize == 0) {
     //    $redis->set('helioviewer:movie_queue_wait', 0);
     //    return;
     //}
 }