laravel - QUEUE_CONNECTION 'database' 有效,但 'redis' 抛出 'Array to String conversion'
问题描述
我只是想运行一个事件和监听器循环并将一个模型传递给它
event(new LabelsCreated($model, 'string'));
这与 完美配合,QUEUE_CONNECTION=database
但QUEUE_CONNECTION=redis
它会给我一个错误:
#message:“数组到字符串的转换”
#代码:0
#file:“/home/vagrant/Code/Upworks/myproj/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php”
#线:302
#严重性:E_NOTICE
我的事件类如下所示:
class LabelsCreated
{
use Dispatchable, SerializesModels;
public $model;
public $string;
public function __construct($model, $string)
{
$this->model = $model;
$this->string = $string;
// comes here
}
}
但它根本没有让我的听众排队。
我的 config/queue.php,redis 数组如下所示:
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => ['default', 'export'],
'retry_after' => 90,
'block_for' => null,
],
它可能指的是关键的“队列”值吗?
解决方案
这是我的 config/queue.php 中的问题
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => ['default', 'export'], // THIS LINE
'retry_after' => 90,
'block_for' => null,
],
我尝试将其保留为默认值
'queue' => 'default'
它在同一个连接上运行多个队列。
推荐阅读
- html - 如何使用 WebView 加载 Google Play 页面?
- javascript - javascript .data() 通过空格剪切字符串内容
- gnat - 如何在 GPS 中配置 clang
- javascript - javascript数组树搜索保留节点和父母
- elasticsearch - 升级到 TFS 2018 Update 2 后搜索失败
- ios - iOS 中的通话/短信记录?
- python - Python Plotly:滑块不刷新散点图
- python - 在 Python 中通过二维数组汇总 ndarray
- javascript - AngularJs 中的组件级服务
- javascript - 如何在双引号内使用单引号而双引号已经在单引号内?