N°7008 - Fix missing background tasks in CRON when autoloaded and NOT in "developer_mode" (#578)

This commit is contained in:
Molkobain
2024-02-16 17:14:53 +01:00
committed by GitHub
parent 15fa495458
commit b716a3965c

View File

@@ -44,12 +44,6 @@ if (!file_exists($sConfigFile))
require_once(APPROOT.'/application/startup.inc.php');
// Temporary fix until below bug is resolved properly:
// N°7008 - Fix missing background tasks in CRON when NOT in "developer_mode"
require_once(APPROOT.'/sources/SessionTracker/SessionGC.php');
require_once(APPROOT.'/sources/Service/TemporaryObjects/TemporaryObjectGC.php');
require_once(APPROOT.'/sources/Service/Notification/Event/EventiTopNotificationGC.php');
$oCtx = new ContextTag(ContextTag::TAG_CRON);
function ReadMandatoryParam($oP, $sParam, $sSanitizationFilter = 'parameter')
@@ -414,14 +408,7 @@ function ReSyncProcesses($oP, $bVerbose, $bDebug)
$oNow = new DateTime();
$aProcesses = array();
foreach (get_declared_classes() as $sTaskClass)
{
$oRefClass = new ReflectionClass($sTaskClass);
if ($oRefClass->isAbstract())
{
continue;
}
if ($oRefClass->implementsInterface('iProcess'))
foreach (utils::GetClassesForInterface('iProcess', '', ['[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]']) as $sTaskClass)
{
$oProcess = new $sTaskClass;
$aProcesses[$sTaskClass] = $oProcess;
@@ -480,7 +467,6 @@ function ReSyncProcesses($oP, $bVerbose, $bDebug)
unset($aTasks[$sTaskClass]);
}
}
}
// Remove all the tasks not having a valid class
foreach ($aTasks as $oTask)