5 * Contains \Drupal\Console\Command\Cron\ReleaseCommand.
8 namespace Drupal\Console\Command\Cron;
10 use Symfony\Component\Config\Definition\Exception\Exception;
11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Output\OutputInterface;
13 use Symfony\Component\Console\Command\Command;
14 use Drupal\Core\Lock\LockBackendInterface;
15 use Drupal\Console\Core\Utils\ChainQueue;
16 use Drupal\Console\Core\Command\Shared\CommandTrait;
17 use Drupal\Console\Core\Style\DrupalStyle;
19 class ReleaseCommand extends Command
24 * @var LockBackendInterface
31 protected $chainQueue;
34 * ReleaseCommand constructor.
36 * @param LockBackendInterface $lock
37 * @param ChainQueue $chainQueue
39 public function __construct(
40 LockBackendInterface $lock,
41 ChainQueue $chainQueue
44 $this->chainQueue = $chainQueue;
45 parent::__construct();
51 protected function configure()
54 ->setName('cron:release')
55 ->setDescription($this->trans('commands.cron.release.description'));
61 protected function execute(InputInterface $input, OutputInterface $output)
63 $io = new DrupalStyle($input, $output);
66 $this->lock->release('cron');
68 $io->info($this->trans('commands.cron.release.messages.released'));
69 } catch (Exception $e) {
70 $io->error($e->getMessage());
75 $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'all']);