Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/WorkerEvents/CronRunningEvent.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\WorkerEvents;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Symfony\Component\Messenger\Event\WorkerRunningEvent;
  5. /**
  6.  * Class ExtractFailedEvent
  7.  * @package App\Event
  8.  */
  9. class CronRunningEvent implements EventSubscriberInterface
  10. {
  11.     public function onWorkerRunning(WorkerRunningEvent $event): void
  12.     {
  13.         if ($event->isWorkerIdle()) {
  14.             $event->getWorker()->stop();
  15.         }
  16.     }
  17.     /**
  18.      * @return array<string>
  19.      */
  20.     public static function getSubscribedEvents()
  21.     {
  22.         return [
  23.             WorkerRunningEvent::class => 'onWorkerRunning',
  24.         ];
  25.     }
  26. }