+ }
+ }
+
+ /**
+ * @param integer $n Number of jobs to try to run
+ * @param LoggerInterface $runJobsLogger
+ */
+ private function triggerSyncJobs( $n, LoggerInterface $runJobsLogger ) {
+ $runner = new JobRunner( $runJobsLogger );
+ $runner->run( [ 'maxJobs' => $n ] );
+ }
+
+ /**
+ * @param integer $n Number of jobs to try to run
+ * @param LoggerInterface $runJobsLogger
+ * @return bool Success
+ */
+ private function triggerAsyncJobs( $n, LoggerInterface $runJobsLogger ) {
+ // Do not send request if there are probably no jobs
+ $group = JobQueueGroup::singleton();
+ if ( !$group->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) {
+ return true;