getJobModelBuilder(); if ($jobBuilder->count() <= 0) { return true; } // Executes all pending jobs when running the runScheduledTasks.php on the CLI if (runOnCLI('runScheduledTasks.php')) { while ($jobBuilder->count()) { $jobQueue->runJobInQueue(); } return true; } // Executes a limited number of jobs when processing a request (new JobRunner($jobQueue)) ->withMaxExecutionTimeConstrain() ->withMaxJobsConstrain() ->withMaxMemoryConstrain() ->withEstimatedTimeToProcessNextJobConstrain() ->processJobs($jobBuilder); return true; } }