Skip to content

Commit a0f3f93

Browse files
authored
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
1 parent 51035af commit a0f3f93

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Command/Update/EntitiesCommand.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,15 @@ protected function configure()
6464
$this
6565
->setName('update:entities')
6666
->setDescription($this->trans('commands.update.entities.description'))
67+
->enableMaintenance()
6768
->setAliases(['upe']);
68-
;
6969
}
7070

7171
/**
7272
* {@inheritdoc}
7373
*/
7474
protected function execute(InputInterface $input, OutputInterface $output)
7575
{
76-
//$state = $this->getDrupalService('state');
77-
$this->getIo()->info($this->trans('commands.site.maintenance.messages.maintenance-on'));
78-
$this->getIo()->info($this->trans('commands.update.entities.messages.start'));
79-
$this->state->set('system.maintenance_mode', true);
80-
8176
try {
8277
$this->entityDefinitionUpdateManager->applyUpdates();
8378
/* @var EntityStorageException $e */
@@ -88,9 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8883
$this->getIo()->error(strtr('%type: @message in %function (line %line of %file).', $variables));
8984
}
9085

91-
$this->state->set('system.maintenance_mode', false);
9286
$this->getIo()->info($this->trans('commands.update.entities.messages.end'));
9387
$this->chainQueue->addCommand('cache:rebuild', ['cache' => 'all']);
94-
$this->getIo()->info($this->trans('commands.site.maintenance.messages.maintenance-off'));
9588
}
9689
}

0 commit comments

Comments
 (0)