Cron parallelization

* refactor counts
This commit is contained in:
Eric Espie
2022-07-06 10:11:53 +02:00
parent 6735bb8721
commit fe675738f4

View File

@@ -278,7 +278,7 @@ function CronExec($oP, $bVerbose, $bDebug = false)
} }
// Tasks to run later // Tasks to run later
if ($bVerbose && $aTasks == []) { if ($bVerbose && count($aTasks) == 0) {
$oP->p('--'); $oP->p('--');
$oSearch = new DBObjectSearch('BackgroundTask'); $oSearch = new DBObjectSearch('BackgroundTask');
$oSearch->AddCondition('next_run_date', $sNow, '>'); $oSearch->AddCondition('next_run_date', $sNow, '>');
@@ -291,7 +291,7 @@ function CronExec($oP, $bVerbose, $bDebug = false)
} }
} }
} }
if ($aTasks == []) { if (count($aTasks) == 0) {
if ($bVerbose) { if ($bVerbose) {
$oP->p("Sleeping...\n"); $oP->p("Sleeping...\n");
} }