Skip to content
Permalink
Browse files

3943 maintenance mode update entities (#3963)

* Add new arguments key and target. Make it possible use not only default target for db connections

* Enable maintenance moude during the entities update
  • Loading branch information...
LOBsTerr committed Apr 10, 2019
1 parent 51035af commit a0f3f933029a339a52814ec84f7016e4d5fde5d9
Showing with 1 addition and 8 deletions.
  1. +1 −8 src/Command/Update/EntitiesCommand.php
@@ -64,20 +64,15 @@ protected function configure()
$this
->setName('update:entities')
->setDescription($this->trans('commands.update.entities.description'))
->enableMaintenance()
->setAliases(['upe']);
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
//$state = $this->getDrupalService('state');
$this->getIo()->info($this->trans('commands.site.maintenance.messages.maintenance-on'));
$this->getIo()->info($this->trans('commands.update.entities.messages.start'));
$this->state->set('system.maintenance_mode', true);
try {
$this->entityDefinitionUpdateManager->applyUpdates();
/* @var EntityStorageException $e */
@@ -88,9 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->getIo()->error(strtr('%type: @message in %function (line %line of %file).', $variables));
}
$this->state->set('system.maintenance_mode', false);
$this->getIo()->info($this->trans('commands.update.entities.messages.end'));
$this->chainQueue->addCommand('cache:rebuild', ['cache' => 'all']);
$this->getIo()->info($this->trans('commands.site.maintenance.messages.maintenance-off'));
}
}

0 comments on commit a0f3f93

Please sign in to comment.
You can’t perform that action at this time.