Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部分手机在使用YYCache存储时会清除数据 #157

Open
johnchen opened this issue Mar 19, 2021 · 9 comments
Open

部分手机在使用YYCache存储时会清除数据 #157

johnchen opened this issue Mar 19, 2021 · 9 comments

Comments

@johnchen
Copy link

YYCache *cache = [[YYCache alloc]initWithName: CacheKeyUserManager];
[cache setObject:_strServerIP forKey: KeyStrServerIP];
你好,我想咨询一下,这种方式创建保存数据 部分手机型号的反馈会自动清除。

@mghnmtt
Copy link

mghnmtt commented Apr 21, 2021

内存满了吧

@sensencoder
Copy link

内存满了吧

怎么解决啊,用这个YYCache内存满了怎么改啊

@mghnmtt
Copy link

mghnmtt commented Aug 17, 2021

存储目录别放到cache

@yayanet
Copy link

yayanet commented Jan 28, 2022

我们发现一个场景,手机存储满了之后,初始化YYCache失败会自动清理所有数据,代码:

[self _reset]; // rebuild

@yongshideweiyi
Copy link

我现在存储在Documents目录,手机存储空间还有很多,有时候数据也会被清空!有没有大佬是到什么原因的??

@anchao-lu
Copy link

同样的问题,iPhone12 iOS14.6 都会出现删除缓存的情况

@roMummy
Copy link

roMummy commented Nov 15, 2023

我们发现一个场景,手机存储满了之后,初始化YYCache失败会自动清理所有数据,代码:

[self _reset]; // rebuild

对于我来说,在多个线程同时初始化yycache会导致数据库被锁定 进而执行清空操作

@LatinJackey
Copy link

@yongshideweiyi 你好,请问你找到问题了吗,我也出现这种情况了

@yongshideweiyi
Copy link

@yongshideweiyi 你好,请问你找到问题了吗,我也出现这种情况了

时间有点久了,当时翻了源码我记得好像是初始化时有可能失败,如果失败了就会把数据清除,具体的记不清了!后来我们就把这部分数据迁移到数据库存储了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants