Apply suggestions

This commit is contained in:
Philipp Holzer 2023-01-03 17:24:05 +01:00
commit b439df892a
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
14 changed files with 69 additions and 66 deletions

View file

@ -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