Skip to content

Commit

Permalink
Release 1.6.21
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhzh committed Oct 24, 2016
1 parent eeb49aa commit 683f7e5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SensorsAnalyticsSDK"
s.version = "1.6.20"
s.version = "1.6.21"
s.summary = "The offical iOS SDK of Sensors Analytics."
s.homepage = "http://www.sensorsdata.cn"
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }
Expand Down
23 changes: 16 additions & 7 deletions SensorsAnalyticsSDK/SensorsAnalyticsSDK/MessageQueueBySqlite.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,13 @@ - (BOOL) removeFirstRecords:(NSUInteger)recordSize withType:(NSString *)type {
NSUInteger removeSize = MIN(recordSize, _messageCount);
NSString* query = [NSString stringWithFormat:@"DELETE FROM dataCache WHERE id IN (SELECT id FROM dataCache WHERE type = '%@' ORDER BY id ASC LIMIT %lu);", type, (unsigned long)removeSize];
char* errMsg;
if (sqlite3_exec(_database, [query UTF8String], NULL, NULL, &errMsg) != SQLITE_OK) {
SAError(@"Failed to delete record msg=%s", errMsg);
@try {
if (sqlite3_exec(_database, [query UTF8String], NULL, NULL, &errMsg) != SQLITE_OK) {
SAError(@"Failed to delete record msg=%s", errMsg);
return NO;
}
} @catch (NSException *exception) {
SAError(@"Failed to delete record exception=%@",exception);
return NO;
}
_messageCount = [self sqliteCount];
Expand Down Expand Up @@ -149,13 +154,17 @@ - (NSInteger) sqliteCount {
}

- (BOOL) vacuum {
NSString* query = @"VACUUM";
char* errMsg;
if (sqlite3_exec(_database, [query UTF8String], NULL, NULL, &errMsg) != SQLITE_OK) {
SAError(@"Failed to delete record msg=%s", errMsg);
@try {
NSString* query = @"VACUUM";
char* errMsg;
if (sqlite3_exec(_database, [query UTF8String], NULL, NULL, &errMsg) != SQLITE_OK) {
SAError(@"Failed to delete record msg=%s", errMsg);
return NO;
}
return YES;
} @catch (NSException *exception) {
return NO;
}
return YES;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#import <WebKit/WebKit.h>
#endif

#define VERSION @"1.6.20"
#define VERSION @"1.6.21"

#define PROPERTY_LENGTH_LIMITATION 8191

Expand Down

0 comments on commit 683f7e5

Please sign in to comment.