【问题标题】:Laravel/Lumen queue:listen not workingLaravel/流明队列:听不工作
【发布时间】:2016-09-21 00:21:25
【问题描述】:

当我手动检查 redis 时,我可以在 redis 中排队作业。我也知道我需要 predis 和Illuminate\redis

"predis/predis": "^1.0", "illuminate/redis": "5.2.*"

我已经包含并测试了

$app->get('/cache/predis', function () use ($app) {
    $client = new Predis\Client();
    $client->set('foo', 'bar');
    $value = $client->get('foo');
    return response()->json($value);
});
$app->get('/cache/redis', function () use ($app) {

    $cache = $app['cache'];
    $cache->store('redis')->put('bar', 'baz', 10);
    $value = $cache>store('redis')->get('bar');
    return response()->json($value);
});

但是当我运行时:`php artisan queue:listen redis'

它告诉我: [InvalidArgumentException] No connector for []

知道为什么吗?我的config/database.phpconfig/queue.php 都是默认配置

【问题讨论】:

    标签: php laravel laravel-5.2 lumen-5.2


    【解决方案1】:

    在 config/queue.php 中你需要指定你正在使用的队列

    'default' => env('QUEUE_DRIVER', 'sync'),
    

    在这一行(queue.php 的顶部)中,您是否指定您正在使用 redis 详细信息?

    'default' => env('QUEUE_DRIVER', 'redis'),
    

    【讨论】:

    • 我都试过了。由于env('QUEUE_DRIVER','sync'); 它从我的.env 文件中获取,并且该文件设置为redis
    猜你喜欢
    • 2018-06-20
    • 2018-03-15
    • 2014-11-10
    • 1970-01-01
    • 2018-07-30
    • 1970-01-01
    • 2016-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多