setDescription('Run the scheduler'); } public function signalHandler($signal) { switch ($signal) { case SIGTERM: case SIGINT: $this->getSignalHandler()->unregisterAll(); $this->getTaskManager()->stop(); break; } } protected function doExecute(InputInterface $input, OutputInterface $output) { $this->assertTaskManagerIsEnabled(); $this->configureLogger(function () { return $this->getTaskManagerLogFileFactory()->forManager(); }); declare(ticks=1000); $this->getSignalHandler()->register([SIGINT, SIGTERM], [$this, 'signalHandler']); $this->getTaskManager()->addSubscriber(new LockFileSubscriber($this->getTaskManagerLogger(), $this->container['tmp.path'].'/locks')); $this->getTaskManager()->start(); } }