mirror of
https://github.com/friendica/friendica
synced 2025-04-25 14:30:10 +00:00
Setting "maintenance" for pre and post updates
This commit is contained in:
parent
43f0f6bbdc
commit
90f1175cf5
2 changed files with 21 additions and 2 deletions
|
@ -375,6 +375,8 @@ class DBStructure
|
|||
*/
|
||||
public static function update($basePath, $verbose, $action, $install = false, array $tables = null, array $definition = null)
|
||||
{
|
||||
$in_maintenance = DI::config()->get('system', 'maintenance');
|
||||
|
||||
if ($action && !$install) {
|
||||
if (self::isUpdating()) {
|
||||
return DI::l10n()->t('Another database update is currently running.');
|
||||
|
@ -737,8 +739,10 @@ class DBStructure
|
|||
self::checkInitialValues();
|
||||
|
||||
if ($action && !$install) {
|
||||
DI::config()->set('system', 'maintenance', 0);
|
||||
DI::config()->set('system', 'maintenance_reason', '');
|
||||
if (!$in_maintenance) {
|
||||
DI::config()->set('system', 'maintenance', 0);
|
||||
DI::config()->set('system', 'maintenance_reason', '');
|
||||
}
|
||||
|
||||
if ($errors) {
|
||||
DI::config()->set('system', 'dbupdate', self::UPDATE_FAILED);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue