mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 01:58:47 +02:00
N°3234 - Cron rework
* some timezone refactors occurred
This commit is contained in:
@@ -129,8 +129,7 @@ abstract class RotatingLogFileNameBuilder implements iLogFileNameBuilder
|
||||
public function CheckAndRotateLogFile()
|
||||
{
|
||||
$oConfig = utils::GetConfig();
|
||||
$sItopTimeZone = $oConfig->Get('timezone');
|
||||
$timezone = new DateTimeZone($sItopTimeZone);
|
||||
utils::InitTimeZone($oConfig);
|
||||
|
||||
if ($this->GetLastModifiedDateForFile() === null)
|
||||
{
|
||||
@@ -145,11 +144,13 @@ abstract class RotatingLogFileNameBuilder implements iLogFileNameBuilder
|
||||
return;
|
||||
}
|
||||
$oDateTime = DateTime::createFromFormat('U', $iLogDateLastModifiedTimeStamp);
|
||||
$sItopTimeZone = $oConfig->Get('timezone');
|
||||
$timezone = new DateTimeZone($sItopTimeZone);
|
||||
$oDateTime->setTimezone($timezone);
|
||||
$this->SetLastModifiedDateForFile($oDateTime);
|
||||
}
|
||||
|
||||
$oNow = new DateTime('now', $timezone);
|
||||
$oNow = new DateTime();
|
||||
$bShouldRotate = $this->ShouldRotate($this->GetLastModifiedDateForFile(), $oNow);
|
||||
if (!$bShouldRotate)
|
||||
{
|
||||
@@ -830,4 +831,4 @@ class LogFileRotationProcess implements iScheduledProcess
|
||||
|
||||
throw new ProcessException(self::class.' : The configured filename builder is invalid (log_filename_builder_impl="'.$sLogFileNameBuilder.'")');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user