Improved code

This commit is contained in:
Michael 2020-05-16 10:04:09 +00:00
parent 4faef126ff
commit 8e12edc375

View file

@ -291,13 +291,11 @@ class DBStructure
*/ */
public static function update($basePath, $verbose, $action, $install = false, array $tables = null, array $definition = null) public static function update($basePath, $verbose, $action, $install = false, array $tables = null, array $definition = null)
{ {
if (!$install) { if ($action && !$install) {
if (self::isUpdating()) { if (self::isUpdating()) {
return DI::l10n()->t('Another database update is currently running.'); return DI::l10n()->t('Another database update is currently running.');
} }
}
if ($action && !$install) {
DI::config()->set('system', 'maintenance', 1); DI::config()->set('system', 'maintenance', 1);
DI::config()->set('system', 'maintenance_reason', DI::l10n()->t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e'))); DI::config()->set('system', 'maintenance_reason', DI::l10n()->t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e')));
} }