Skip to content

Commit

Permalink
[bugfix] cache 路径写错(对逻辑没影响),DB大小变化判断改为 20kb
Browse files Browse the repository at this point in the history
  • Loading branch information
lijianghuai committed Dec 27, 2024
1 parent 4d9d241 commit 85290b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions LKDBHelper.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LKDBHelper",
"version": "2.7.1",
"version": "2.7.2",
"summary": "全自动的插入,查询,更新,删除, an automatic database operation thread-safe and not afraid of recursive deadlock",
"description": "全面支持 NSArray,NSDictionary, ModelClass, NSNumber, NSString, NSDate, NSData, UIColor, UIImage, CGRect, CGPoint, CGSize, NSRange, int,char,float, double, long.. 等属性的自动化操作(插入和查询)",
"homepage": "https://github.com/li6185377/LKDBHelper-SQLite-ORM",
Expand All @@ -10,7 +10,7 @@
},
"source": {
"git": "https://github.com/li6185377/LKDBHelper-SQLite-ORM.git",
"tag": "2.7.1"
"tag": "2.7.2"
},
"platforms": {
"ios": "12.0",
Expand Down
6 changes: 3 additions & 3 deletions LKDBHelper/Helper/LKDBHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ - (void)runAutoVacuumAction {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *cacheDirectory = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
dbAutoVaccumPath = [cacheDirectory stringByAppendingString:@"lkdb-auto-vacuum.plist"];
dbAutoVaccumPath = [cacheDirectory stringByAppendingPathComponent:@"lkdb-auto-vacuum.plist"];
dbAutoVaccumMap = [NSMutableDictionary dictionaryWithContentsOfFile:dbAutoVaccumPath];
if (!dbAutoVaccumMap) {
dbAutoVaccumMap = [NSMutableDictionary dictionary];
Expand Down Expand Up @@ -395,8 +395,8 @@ - (void)runAutoVacuumAction {
// 无法获取到DB文件大小
return;
}
// DB文件大小变化 > 10kb,才执行DB文件优化
BOOL const needDBAction = labs(dbSize - lastSize) > 1024 * 10;
// DB文件大小变化 > 20kb,才执行DB文件优化
BOOL const needDBAction = labs(dbSize - lastSize) > 1024 * 20;
if (needDBAction) {
// 执行数据分析,提高后续SQL执行效率
if (self.enableAutoAnalyze) {
Expand Down

0 comments on commit 85290b9

Please sign in to comment.