coolseven / notes Goto Github PK
View Code? Open in Web Editor NEW笔记与心得
License: MIT License
笔记与心得
License: MIT License
任务的开始执行的时刻 + expire > 当前时刻 这个不应该是 小于吗 还是我理解错了?
感谢您的文章,已经读了好几遍。
现在有个问题一直很困惑。
因为在PHP-CLI里执行,很多东西不像 web 能直接给回馈。
那我们如何知道程序运行情况呢?
我现在主要是通过 LOG 来记录节点信息
比如 push 任务,我会记录成功还是失败
任务执行失败我也会记录。
但是通过 LOG 来查看这些信息总感觉很不可读,当队列数量起来了,我自己也看不懂
所以想请假一下您是否有用什么可视化管理工具来增强对任务执行情况的可读性
另外:
想 laravel 是有 failed_jobs 表里记录失败任务
设置还有官方维护的 laravel Horizon 。
对队列了解不是比较透彻
官方介绍稀少
对于队列中的监控,执行情况,调度过程等缺少比较易懂的介绍
2.0是thinkphp 5.1用的和5.0->1.x版本估计略有偏差
不知作者是否有空更新下对2.x相关的介绍与完善?
感谢,看了作者的笔记认知提高了不少。
问题如上
有提示processed:application\index\job\hello
但是没有我想要的输出
redis过一会看。。被移除队列了。。。
thinkphp-queue2.0 中有 finally 5.4不支持
我也push成功,但也是不执行任务
thinkphp 执行队列不走index.php入口文件,走的是根目录下的think文件,具体可以使用get_included_files()打印看看,所以假如再index.php入口文件定义了常量,而且再队列里面又有使用到该常量的话,请注意,一般会报错找不到常量。
代码如下:
if ($isJobDone)
{
UserModel::get_user_info(100000); //此处调用的是静态的方法,若修改为db('User')->where($where)->find();则不报错
// 如果任务执行成功, 记得删除任务
$job->delete();
Log::info("任务执行成功");
}
具体错误信息如下:[ error ] [0]class not exists:app\model\User[/*/thinkphp/library/think/Loader.php:457]
若采用db('模型名称')去执行则不报错,想问下有没有什么办法可以使用模型的静态方法而不报错。版本是1.1.6和2.0.4都报错,Tp版本5.0.24 谢谢
D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue
D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue
D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue
文档里面的并行需要怎么设置的? 谢谢
redis驱动下,later方法并没有返回值
在root目录下执行 listen模式
nohup php think /www/wwwroot/think queue:listen --queue ordersuccess > myout.file 2>&1 &
是找不到think文件
work模式 在root目录下是可行的
nohup php /www/wwwroot/think queue:work --daemon --queue cashback > myout.file 2>&1 &
这是个bug!!!!!!
\application\extra\queue.php
\application\config\queue.php
你好,我现在使用tp5队列来做一个风控,买卖股票的订单会随着股票价钱波动产生盈亏,达到某个亏损值的时候我需要进行平仓,可以队列每一秒只能处理15个订单,我想问一下怎么可以加进程,让系统处理更多的订单呢
Redis push时候返回一个随机字符串,但是later时候返回的是一个空,这个是正常的么。
作者大大您好,我按照你的教程写了一个demo,队列已经成功建立,并且在redis里面可以看到队列数据。
但是在命令行执行命令:php think queue:work --queue testqueue,时,报错: [Exception] redis鎵╁睍鏈畨瑁?。。
然后,我想问下,queue的配置文件位置,是固定的吗?可以不可以放到其它位置。
我刚刚学习php不久,希望大牛能抽空回复一下。谢谢。
执行后只输出
rocessed: application\index\job\Hello
你好,我按你写的配置了,控制器执行的时候,直接就把消费者的打印信息,输出出来了,而消费者端起的命令服务,却没有一点反应,实在是找不到问题,能帮我看一下吗?
README.md 说明文件里面图片不显示
感谢楼主的笔记, 当初就想用think-queue,结果完全看不懂,还好现在入门级的操作会搞了。
任务失败始终没有进入我自己的处理, 按你的方法把queue.failed改成queue_failed也是没用哦
环境php7.3,redis 6.2.6 ,调用push之后就会无限循环执行,无法停止,redis队列中没有找到数据,queue脚本重启后仍继续执行,清除redis全部缓存或者创建对应Job类后才会恢复
队列 有时会出这个错误 不知道 怎么调试 是哪的问题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.