Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复未设置 module 时,报 runAction on NULL 的 bug 问题 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yunlong2cn
Copy link

执行 ./yii queue/run 时,提示如下:

Exception 'Error' with message 'Call to a member function runAction() on null'
in /data/vendor/urbanindo/yii2-queue/src/Queue.php:202

使用的是 yii2 advance 版本,main-local.php 如下:

'redis' => [
            'class' => '\yii\redis\Connection',
            'hostname' => 'redis-host',
            'port' => 6379,
        ],
'queue' => [
            'class' => '\UrbanIndo\Yii2\Queue\Queues\RedisQueue',
            'key' => 'Yunlong'
        ]

在 queue 中未设置 module 属性,导致以上错误

@petrabarus
Copy link
Contributor

petrabarus commented Jan 13, 2017 via email

@Yunlong2cn
Copy link
Author

Okey,it happed when i use yii2-advanced console application not add new modules,show me some errors like:

Exception 'Error' with message 'Call to a member function runAction() on null'
in /data/vendor/urbanindo/yii2-queue/src/Queue.php:202

so,we can add default modules like this:

$this->module = \Yii::$app;

visit code to find the details

@petrabarus
Copy link
Contributor

Can you create a test for this maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants