【发布时间】:2019-09-11 20:47:05
【问题描述】:
我正在尝试调用自定义命令以在启动 Horizon 后从 CLI 分派作业。
journal:add 是一个自定义命令,用于将日志详细信息添加到 mysql 数据库。
$this->line('<fg=red>Migrate and refreshing databases</>');
sleep(1);
$this->call('migrate:refresh');
$this->line('<fg=red>Flushing the redis queue</>');
sleep(1);
exec('redis-cli flushall');
sleep(1);
$this->line('<fg=red>Starting Horizon</>');
$this->call('horizon');
sleep(1);
$this->line('<fg=red>Adding test journal</>');
$this->call('journal:add', ['issn'=>'1098-2418']);
预期结果是在 Horizon 启动后将日志作业分派到队列中。
目前,代码启动了 Horizon,但之后没有做任何事情。
【问题讨论】:
标签: laravel command laravel-artisan horizon