laravel-5.7 - 我的 Laravel Schedule withoutOverlapping() 不适用于 runInBackground()
问题描述
我看到其他人在这里遇到了同样的问题,但是当我尝试他们的解决方案时,它似乎仍然不起作用。
我正在运行 Laravel 5.7
我已将 redis 设置为我的缓存:
CACHE_DRIVER=redis
但是在 database.php 中我需要编辑什么吗?
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
我已经做好了:
composer install predis/predis
我可以确认 redis 正在工作:
KEYS *
1) "laravel:framework/schedule-3032780d7b5657bd5e6ba0fef1359f330895c3da"
我有 15 个任务在不同时间运行,但似乎第一个任务运行,但之后的其他任务没有。
$schedule->command( 'do:task one' )->cron( '1/3 * * * *' )->withoutOverlapping()->runInBackground();
$schedule->command( 'do:task two' )->cron( '1/5 * * * *' )->withoutOverlapping()->runInBackground();
$schedule->command( 'do:task three' )->cron( '1/15 * * * *' )->withoutOverlapping()->runInBackground();
有没有其他人遇到过这个?
谢谢
解决方案
推荐阅读
- jenkins - 2 个移动应用程序的自动化 UITest 策略 - 用户应用程序/管理应用程序
- clojurescript - 发射困难
, 使用 clojurescript + 试剂 + cljsjs/ag-grid-react - c# - 模型忽略 HasPrecision 属性
- c++ - 构造函数的显式模板特化 (g++)
- python - Pandas:对于特定列中的所有重复条目集,获取一些信息第 2 部分
- search - 如何获取apache solr中特定文档中存在多少个术语列表
- azure-storage - Azure Blob 下载任务编辑器
- git - 为什么给出哈希时 git log 会抛出致命的坏对象?
- java - 给定多个方法的调用顺序的 Mockito 中的条件存根
- excel - Excel 2017。7 个工作表,1 个过滤器来更改它们