#600·lowdb

JSON format error causes card freeze

Author: oneQiuCreated Dec 2, 2024Updated Dec 2, 2024

我在使用lowdb的时候,在高频写入操作的时候,小概率出现json格式错误的情况,导致我整个应用卡死,我应该怎么处理兜底逻辑。

When I use lowdb, there is a small probability that JSON format errors will occur during high-frequency write operations, causing my entire application to freeze. How should I handle the fallback logic?

这是错误 this is error

image

image

这是代码 this is code image