【发布时间】:2018-09-01 16:40:47
【问题描述】:
所以,
a 我第一次尝试使用 Commands 类,我想让队列消息比[2018-09-01 17:57:47][276] Processing: Illuminate\Foundation\Console\QueuedCommand更具可读性
所以我所做的是以下;
我用protected $signature = 'recording:convert {recording_id}'; 和protected $description = 'Convert a recording from mkv to mp4 using an recording id and making use of ffmpeg'; 注册了命令ConvertRecording。这有一个空的构造函数,因为我不需要将对象传递给它......而且句柄方法只有一些工作代码还有一些$this->log() 命令...
现在,当我调用 artisan 命令时,我使用以下代码:
$exitCode = Artisan::queue('recording:convert', [
'recording_id' => $recording_id
]);
它附加到队列中,但我只收到这样的消息:
[2018-09-01 17:57:47][276] Processing: Illuminate\Foundation\Console\QueuedCommand
[2018-09-01 17:58:16][276] Processed: Illuminate\Foundation\Console\QueuedCommand
如何将其更改为 [2018-09-01 17:58:16] Procesing: Video with ID [video ID here]
【问题讨论】:
标签: laravel queue laravel-5.6