Skip to content

Commit

Permalink
fix #2756: maintain maintenance mode if previously enabled (#2757)
Browse files Browse the repository at this point in the history
  • Loading branch information
smalot authored and jmolivas committed Oct 15, 2016
1 parent a131ac1 commit 82fca74
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Command/Update/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
update_fix_compatibility();
$updates = update_get_update_list();
$this->checkUpdates($io);
$maintenance_mode = $this->state->get('system.maintenance_mode', false);

$io->info($this->trans('commands.site.maintenance.description'));
$this->state->set('system.maintenance_mode', true);
if (!$maintenance_mode) {
$io->info($this->trans('commands.site.maintenance.description'));
$this->state->set('system.maintenance_mode', true);
}

$this->runUpdates($io, $updates);
$this->runPostUpdates($io);

$this->state->set('system.maintenance_mode', false);
$io->info($this->trans('commands.site.maintenance.messages.maintenance-off'));
if (!$maintenance_mode) {
$this->state->set('system.maintenance_mode', false);
$io->info($this->trans('commands.site.maintenance.messages.maintenance-off'));
}

$this->chainQueue
->addCommand('cache:rebuild', ['cache' => 'all']);
Expand Down

0 comments on commit 82fca74

Please sign in to comment.