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
<?php
namespace App\WorkerEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Messenger\Event\WorkerRunningEvent;
/**
* Class ExtractFailedEvent
* @package App\Event
*/
class CronRunningEvent implements EventSubscriberInterface
{
public function onWorkerRunning(WorkerRunningEvent $event): void
{
if ($event->isWorkerIdle()) {
$event->getWorker()->stop();
}
}
/**
* @return array<string>
*/
public static function getSubscribedEvents()
{
return [
WorkerRunningEvent::class => 'onWorkerRunning',
];
}
}