classes/Tasks/BatchManager.php
public function dispatchBatchesIfNeeded() {
        foreach(static::$batchClasses as $batch => $batchClass) {
            if ($this->status($batch)) {
                $lastRun = $this->lastRun($batch);

                if ((time() - $lastRun) > 60) {
                    $this->setLastRun($batch, time());

                    /** @var BackgroundProcess $process */
                    $process = new $batchClass();
                    $process->dispatch();
                }
            }
        }
    }
public function dispatchBatchesIfNeeded() {
        foreach(static::$batchClasses as $batch => $batchClass) {
            if ($this->status($batch)) {
                $lastRun = $this->lastRun($batch);

                if ((time() - $lastRun) > 60) {
                    $this->setLastRun($batch, time());

                    /** @var BackgroundProcess $process */
                    $process = new $batchClass();
                    $process->dispatch();
                }
            }
        }
    }
public function dispatchBatchesIfNeeded ( ) { foreach ( static :: $ batchClasses as $ batch => $ batchClass ) { if ( $ this -> status ( $ batch ) ) { $ lastRun = $ this -> lastRun ( $ batch ) ; if ( ( time ( ) - $ lastRun ) > 60 ) { $ this -> setLastRun ( $ batch , time ( ) ) ; /** @var BackgroundProcess $process */ $ process = new $ batchClass ( ) ; $ process -> dispatch ( ) ; } } } }
Determines if enough time has elapsed since the last time the batch was "forced" to run and then runs it if so
Determines if enough time has elapsed since the last time the batch was forced to run and then runs it if so