chg: [CLI] runUpdates updated to purge any pending db lock first

feature/publication-blocking-same-user
iglocska 2023-12-14 14:19:46 +01:00
parent 100702244b
commit d1c09533c6
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 0 deletions

View File

@ -540,6 +540,10 @@ class AdminShell extends AppShell
$whoami = ProcessTool::whoami();
if (in_array($whoami, ['httpd', 'www-data', 'apache', 'wwwrun', 'travis', 'www'], true) || $whoami === Configure::read('MISP.osuser')) {
$this->out('Executing all updates to bring the database up to date with the current version.');
$lock = $this->AdminSetting->find('first', array('conditions' => array('setting' => 'update_locked')));
if (!empty($lock)) {
$this->AdminSetting->delete($lock['AdminSetting']['id']);
}
$processId = empty($this->args[0]) ? false : $this->args[0];
$this->Server->runUpdates(true, false, $processId);
$this->Server->cleanCacheFiles();