public function onRemove(QueueRemoveEvent $event)
 {
     try {
         $result = $this->gateway->deleteQuery()->start()->filterByJob($event->getJobId())->filterByExpiredOrEmptyLockout($event->getNow())->end()->delete();
         $event->setResult($result);
     } catch (DBALGatewayException $e) {
         throw new LaterJobException($e->getMessage(), 0, $e);
     }
 }
Example #2
0
 public function testQueueRemoveEvent()
 {
     $now = new DateTime();
     $job_id = '4b336e15-cac0-3307-8b81-f1de26e6c383';
     $result = true;
     $remove = new QueueRemoveEvent($job_id, $now);
     $remove->setResult(true);
     $this->assertEquals($result, $remove->getResult());
     $this->assertEquals($now, $remove->getNow());
     $this->assertEquals($job_id, $remove->getJobId());
 }