mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
N°2240 - Supportability - Maintenance mode exit on MTP or core update error
This commit is contained in:
@@ -95,7 +95,6 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
|
||||
'iTopUpdate:UI:RestoreArchive' => 'You can restore your application from the archive \'%1$s\'',
|
||||
'iTopUpdate:UI:RestoreBackup' => 'You can restore the database from \'%1$s\'',
|
||||
'iTopUpdate:UI:MaintenanceModeActive' => 'The application is currently under maintenance, no user can access the application. You have to run a setup or restore the application archive to return in normal mode.',
|
||||
'iTopUpdate:UI:UpdateDone' => 'Upgrade successful',
|
||||
'Menu:iTopUpdate' => 'Application Upgrade',
|
||||
'Menu:iTopUpdate+' => 'Application Upgrade',
|
||||
|
||||
@@ -94,7 +94,6 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
|
||||
'iTopUpdate:UI:RestoreArchive' => 'Vous pouvez restaurer l\'application depuis \'%1$s\'',
|
||||
'iTopUpdate:UI:RestoreBackup' => 'Vous pouvez restaurer la base de données depuis \'%1$s\'',
|
||||
'iTopUpdate:UI:MaintenanceModeActive' => 'L\'application est actuellement en maintenance, aucun utilisateur n\'a accès à l\'application. Vous pouvez lancer un setup ou réinstaller l\'application depuis une sauvegarde pour retourner dans un mode normal.',
|
||||
'iTopUpdate:UI:UpdateDone' => 'Mise à jour effectuée',
|
||||
'Menu:iTopUpdate' => 'Mise à jour de l\'application',
|
||||
'Menu:iTopUpdate+' => 'Mise à jour de l\'application',
|
||||
|
||||
@@ -13,6 +13,7 @@ use Combodo\iTop\FilesInformation\Service\FilesIntegrity;
|
||||
use DBBackup;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use iTopExtension;
|
||||
use iTopExtensionsMap;
|
||||
use iTopMutex;
|
||||
@@ -162,6 +163,13 @@ final class CoreUpdater
|
||||
catch (Exception $e)
|
||||
{
|
||||
SetupLog::error($e->getMessage());
|
||||
try
|
||||
{
|
||||
SetupUtils::ExitReadOnlyMode();
|
||||
} catch (Exception $e1)
|
||||
{
|
||||
IssueLog::Error("ExitMaintenance: ".$e1->getMessage());
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +78,6 @@
|
||||
<span>{{ 'iTopUpdate:UI:RestoreBackup'|dict_format(sBackupFile) }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<span>{{ 'iTopUpdate:UI:MaintenanceModeActive'|dict_s }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
|
||||
@@ -149,6 +149,10 @@ class MFCompiler
|
||||
// Cleanup the temporary directory
|
||||
SetupUtils::rrmdir($sTempTargetDir);
|
||||
}
|
||||
if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode)
|
||||
{
|
||||
SetupUtils::ExitMaintenanceMode();
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -157,10 +161,6 @@ class MFCompiler
|
||||
// Move the results to the target directory
|
||||
SetupUtils::movedir($sTempTargetDir, $sFinalTargetDir);
|
||||
}
|
||||
if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode)
|
||||
{
|
||||
SetupUtils::ExitMaintenanceMode();
|
||||
}
|
||||
|
||||
// Reset the opcache since otherwise the PHP "model" files may still be cached !!
|
||||
// In case of bad luck (this happens **sometimes** - see N. 550), we may analyze the database structure
|
||||
|
||||
Reference in New Issue
Block a user