当我手动检查 redis 时,我可以在 redis 中排队作业。我也知道我需要 predis 和 illuminate\redis
"predis/predis": "^1.0",
"illuminate/redis": "5.2.*"
我已经包含并测试了
$app->get('/cache/predis', function () use ($app) {
$client = new PredisClient();
$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.php
和config/queue.php
都是默认配置
在配置/队列中.php您需要指定正在使用的队列
'default' => env('QUEUE_DRIVER', 'sync'),
在此行(队列顶部.php)中,您是否指定正在使用 redis 详细信息?
'default' => env('QUEUE_DRIVER', 'redis'),