Apply suggestions
This commit is contained in:
parent
072464119a
commit
b439df892a
14 changed files with 69 additions and 66 deletions
|
@ -100,7 +100,7 @@ HELP;
|
|||
|
||||
$enabled = intval($this->getArgument(0));
|
||||
|
||||
$transactionConfig = $this->config->transactional();
|
||||
$transactionConfig = $this->config->beginTransaction();
|
||||
|
||||
$transactionConfig->set('system', 'maintenance', $enabled);
|
||||
|
||||
|
@ -112,7 +112,7 @@ HELP;
|
|||
$transactionConfig->delete('system', 'maintenance_reason');
|
||||
}
|
||||
|
||||
$transactionConfig->save();
|
||||
$transactionConfig->commit();
|
||||
|
||||
if ($enabled) {
|
||||
$mode_str = "maintenance mode";
|
||||
|
|
|
@ -101,9 +101,10 @@ HELP;
|
|||
$old_host = str_replace('http://', '@', Strings::normaliseLink($old_url));
|
||||
|
||||
$this->out('Entering maintenance mode');
|
||||
$this->config->set('system', 'maintenance', true, false);
|
||||
$this->config->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url, false);
|
||||
|
||||
$this->config->beginTransaction()
|
||||
->set('system', 'maintenance', true)
|
||||
->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url)
|
||||
->commit();
|
||||
try {
|
||||
if (!$this->database->transaction()) {
|
||||
throw new \Exception('Unable to start a transaction, please retry later.');
|
||||
|
@ -189,10 +190,10 @@ HELP;
|
|||
return 1;
|
||||
} finally {
|
||||
$this->out('Leaving maintenance mode');
|
||||
$this->config->transactional()
|
||||
$this->config->beginTransaction()
|
||||
->set('system', 'maintenance', false)
|
||||
->delete('system', 'maintenance_reason')
|
||||
->save();
|
||||
->commit();
|
||||
}
|
||||
|
||||
// send relocate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue