setDescription('Run the scheduler'); } public function signalHandler($signal) { switch ($signal) { case SIGTERM: case SIGINT: $this->container['signal-handler']->unregisterAll(); $this->container['task-manager']->stop(); break; } } protected function doExecute(InputInterface $input, OutputInterface $output) { declare(ticks=1); if ($this->container['task-manager.logger.configuration']['enabled']) { $file = $this->container['task-manager.log-file.factory']->forManager(); $this->container['task-manager.logger']->pushHandler(new RotatingFileHandler($file->getPath(), $this->container['task-manager.logger.configuration']['max-files'], $this->container['task-manager.logger.configuration']['level'])); } $this->container['signal-handler']->register([SIGINT, SIGTERM], [$this, 'signalHandler']); $this->container['task-manager']->addSubscriber(new LockFileSubscriber($this->container['task-manager.logger'], $this->container['root.path'].'/tmp/locks')); $this->container['task-manager']->start(); } }