ibireme/YYCache

-[YYKVStorage _dbExecute:] line:182 sqlite exec error (5): database is locked

jksniper opened this issue · 1 comments

如题,在对本地缓存异步读取的时候很频繁的发生这样的错误,然后缓存被删,gg。
-[YYKVStorage _dbExecute:] line:182 sqlite exec error (5): database is locked
2019-12-17 11:38:58.225945+0800 xxxxx[389:27234] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/6A2C58F1-C93F-4B4E-A16A-014532078A6C/Library/Caches/CacheOfChapters/manifest.sqlite-shm

多线程同时操作同一张表引起,尝试自己加一个全局锁试一下 https://www.jianshu.com/p/6422ae4e06c2