mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2240 - Supportability - Maintenance mode
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
//
|
||||
// Maintenance message display functions
|
||||
// Only included by approot.inc.php
|
||||
//
|
||||
|
||||
/**
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user