N°2240 - Supportability - Maintenance mode

This commit is contained in:
Eric
2019-10-02 10:18:07 +02:00
parent 46c553fbad
commit b7c795c313
3 changed files with 17 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
//
// Maintenance message display functions
// Only included by approot.inc.php
//
/**

View File

@@ -31,7 +31,7 @@ if (file_exists(MAINTENANCE_MODE_FILE) && !$bBypassMaintenance)
http_response_code(503);
// Display message depending on the request
include(APPROOT.'maintenancemsg.php');
include(APPROOT.'application/maintenancemsg.php');
switch (true)
{

View File

@@ -1839,7 +1839,7 @@ EOF
public final static function EnterMaintenanceMode($oConfig)
{
@touch(MAINTENANCE_MODE_FILE);
SetupPage::log("----> Entering maintenance mode");
self::Log("----> Entering maintenance mode");
try
{
// Wait for cron to stop
@@ -1862,7 +1862,7 @@ EOF
$iTimeLimit = $iStarted + $iMaxDuration;
while ($oMutex->IsLocked())
{
SetupPage::log("Waiting for cron to stop ($iCount)");
self::Log("Waiting for cron to stop ($iCount)");
$iCount++;
sleep(10);
if (time() > $iTimeLimit)
@@ -1882,7 +1882,19 @@ EOF
@unlink(MAINTENANCE_MODE_FILE);
if ($bLog)
{
SetupPage::log("<---- Exiting maintenance mode");
self::Log("<---- Exiting maintenance mode");
}
}
private final static function Log($sText)
{
if (class_exists('SetupPage'))
{
SetupPage::log($sText);
}
else
{
IssueLog::Info($sText);
}
}
}