walkor / redis-queue

Message queue system written in PHP based on workerman and backed by Redis.
35 stars 8 forks source link

如何优雅抛出异常而不堆栈存出redis中? #10

Closed youfeed closed 6 months ago

youfeed commented 6 months ago

throw new \Excption('异常'); 这样异常给redis弄了一堆报错打印

尝试以下操作

1. config/app.php

debug=>false
error_reporting=>1024

这个是webman的错误打印配置

2.尝试使用trigger_error("超时重试2",E_USER_NOTICE)

还是会打印错误堆栈

找寻源码 webman/queue 是对 workerman/redis-queue的优雅封装,搞不定

因为我已经选择主动抛出异常重试,堆栈信息是否保存到redis起码可选的吧~ redis - fail表体积爆炸

walkor commented 6 months ago

composer require workerman/redis-queue ^1.2.0 webman/redis-queue ^1.3.1 升级下,现在不记录异常调用栈到redis了,记到rutime/log日志文件里了