summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-05-19 10:27:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-05-19 10:56:04 +0200
commit064f5204cc365bcf8c12ef34e6fde92175c9d6fa (patch)
tree1c20230351041b74bc131ab05826ef0cdcb6c97e /core
parentaae9274210ad80e3c313d55999684c03f6e06b2c (diff)
downloadnextcloud-server-064f5204cc365bcf8c12ef34e6fde92175c9d6fa.tar.gz
nextcloud-server-064f5204cc365bcf8c12ef34e6fde92175c9d6fa.zip
Persist the state of the maintenance after an upgrade
* if maintenance mode was enabled before an upgrade it will be enabled afterwards too * fixes #16429
Diffstat (limited to 'core')
-rw-r--r--core/ajax/update.php7
-rw-r--r--core/command/upgrade.php11
2 files changed, 13 insertions, 5 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 22133f9774c..6a29b5b1c33 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -44,12 +44,15 @@ if (OC::checkUpgrade(false)) {
$incompatibleApps = [];
$disabledThirdPartyApps = [];
- $updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
});
- $updater->listen('\OC\Updater', 'maintenanceEnd', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Turned off maintenance mode'));
});
+ $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) {
+ $eventSource->send('success', (string)$l->t('Maintenance mode is kept active'));
+ });
$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Updated database'));
});
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index 7f5d943bb8b..786e2e28ed2 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -107,12 +107,17 @@ class Upgrade extends Command {
$updater->setSimulateStepEnabled($simulateStepEnabled);
$updater->setUpdateStepEnabled($updateStepEnabled);
- $updater->listen('\OC\Updater', 'maintenanceStart', function () use($output) {
+ $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) {
$output->writeln('<info>Turned on maintenance mode</info>');
});
- $updater->listen('\OC\Updater', 'maintenanceEnd',
+ $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) {
+ $output->writeln('<info>Turned off maintenance mode</info>');
+ });
+ $updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) {
+ $output->writeln('<info>Maintenance mode is kept active</info>');
+ });
+ $updater->listen('\OC\Updater', 'updateEnd',
function () use($output, $updateStepEnabled, $self) {
- $output->writeln('<info>Turned off maintenance mode</info>');
$mode = $updateStepEnabled ? 'Update' : 'Update simulation';
$status = $self->upgradeFailed ? 'failed' : 'successful';
$message = "<info>$mode $status</info>";