src/Bootstrap.php
public function runQueueJob($event)
    {
        if (!$event->sender->request->isConsoleRequest && !$event->sender->request->isAdmin) {
            // use cache to ensure this will run only every 30min
            $this->getOrSetHasCache(['admin', 'bootstrap', 'queue'], function() {
                $timestamp = Config::get(Config::CONFIG_QUEUE_TIMESTAMP);
                // if last execution has NOT been done previously (maybe trough a cronjob)
                if ((time() - $timestamp) > (60*25)) {
                    Yii::debug('"Fake-Cronjob" queue run execution.');
                    Yii::$app->adminqueue->run(false);
                    Config::set(Config::CONFIG_QUEUE_TIMESTAMP, time());
                }

                return $timestamp;
            }, 60*30);
        }
    }
public function runQueueJob($event)
    {
        if (!$event->sender->request->isConsoleRequest && !$event->sender->request->isAdmin) {
            // use cache to ensure this will run only every 30min
            $this->getOrSetHasCache(['admin', 'bootstrap', 'queue'], function() {
                $timestamp = Config::get(Config::CONFIG_QUEUE_TIMESTAMP);
                // if last execution has NOT been done previously (maybe trough a cronjob)
                if ((time() - $timestamp) > (60*25)) {
                    Yii::debug('"Fake-Cronjob" queue run execution.');
                    Yii::$app->adminqueue->run(false);
                    Config::set(Config::CONFIG_QUEUE_TIMESTAMP, time());
                }

                return $timestamp;
            }, 60*30);
        }
    }
public function runQueueJob ( $ event ) { if ( ! $ event -> sender -> request -> isConsoleRequest && ! $ event -> sender -> request -> isAdmin ) { // use cache to ensure this will run only every 30min $ this -> getOrSetHasCache ( [ 'admin' , 'bootstrap' , 'queue' ] , function ( ) { $ timestamp = Config :: get ( Config :: CONFIG_QUEUE_TIMESTAMP ) ; // if last execution has NOT been done previously (maybe trough a cronjob) if ( ( time ( ) - $ timestamp ) > ( 60 * 25 ) ) { Yii :: debug ( '"Fake-Cronjob" queue run execution.' ) ; Yii :: $ app -> adminqueue -> run ( false ) ; Config :: set ( Config :: CONFIG_QUEUE_TIMESTAMP , time ( ) ) ; } return $ timestamp ; } , 60 * 30 ) ; } }
Evaluate whether the current queue job should be run or not.

@param \yii\base\Event $event
Evaluate whether the current queue job should be run or not .