N°4227 - Manual iTop restore - protect any restore from cron or db updates and release readonly mode afterward only if restore set it itself

This commit is contained in:
odain
2021-08-12 15:25:15 +02:00
parent 2c026fa891
commit 9e1e5a8a47
3 changed files with 71 additions and 66 deletions

View File

@@ -174,9 +174,8 @@ class DBBackup
{
$bReadonlyBefore = SetupUtils::IsInReadOnlyMode();
SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
//safe zone for db backup => cron is stopped/ itop in readonly
try {
//safe zone for db backup => cron is stopped/ itop in readonly
$bIsCmdbSourceInitialized = CMDBSource::GetMysqli() instanceof mysqli;
if (!$bIsCmdbSourceInitialized) {
$sErrorMsg = 'Cannot backup : CMDBSource not initialized !';
@@ -209,7 +208,6 @@ class DBBackup
//we are in the scope of main process that needs to handle/keep readonly mode (setup for example).
$this->LogInfo("Keep readonly mode after backup");
}
}
}