如何解决频率很第的代码异常。

一段逻辑怎么看都是对的,但是使用过程中会有一两个人出现问题。
如果说查log不太现实

阅读 2.2k
5 个回答

1.增加日志,查日志
2.事务回滚失败的时候会产生这种情况,在数据库查看这几个人的数据完整性。
3.控制变量法,努力想想这些特定人的偶发情况和别人有什么不同
4.建个仿真环境,登上这俩人的账号直接在服务器上断点调试

new Exception 或@
try {
} catch(\Exception $e) {
}

有问题,就查 log 呀,为什么查 log 不现实?可能就是特定的条件下触发的 bug。

It’s not magic. It’s based on computers, and everything computers do have logical
principles behind them which can be learned and understood. Even when you don’t
understand or when the computer does something frustrating or mysterious, there is always,always, always a reason why

推荐问题