php - 如何使用 php artisan serve 命令运行我的调度程序?
问题描述
我schedule->call(what_i_want_to_do)
在 Kernel.php 文件中的 schedule 函数中添加了一个。我知道我可以通过运行php artisan schedule:run
命令来尝试,但是,当我使用php artisan serve
命令启动服务器时,我的调度程序不起作用。
如何使它工作?
我的 kernel.php 时间表
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
Defi::whereDate('date_vis', '=', now())->update(['vis' => 1]);
})->everyMinute();
}
解决方案
认为您还需要运行php artisan schedule:work
https://laravel.com/docs/scheduling#running-the-scheduler-locally
推荐阅读
- unit-testing - 如何测试 Ninject Factory 在 RequestScope 中返回相同的实例
- testing - 执行测试时出错:ERROR 由于出现错误无法准备测试
- ios - Xcode 11 Beta 5 未显示 Swift 5.1
- javascript - 如何使用cheerio和express从instagram获取信息
- acumatica - 字段默认处理程序
- apache-spark - 获取数据框中每一列的最大列长度
- typescript - 上下文类型只是类型推断的另一个术语吗?
- php - 将字符串转换为带有键的数组
- database - 在 wordpress 中合并 2 个数据库
- javascript - 如何在 Jscodeshift 中正确导出 const