...
|
...
|
@@ -293,6 +293,8 @@ static dispatch_queue_t persisting_queue() { |
|
|
|
|
|
} else if (itemData.dataType == YHItemDataTypePerformance) {
|
|
|
YHPerformance *performance = (YHPerformance *)itemData;
|
|
|
performance.net = self.currentStatus.net;
|
|
|
|
|
|
dispatch_async(persisting_queue(), ^{
|
|
|
|
|
|
if ([self writePerformanceToFile:performance]) {
|
...
|
...
|
@@ -354,6 +356,20 @@ static dispatch_queue_t persisting_queue() { |
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
} else if (itemData.dataType == YHItemDataTypePerformance) {
|
|
|
YHPerformance *perfms = (YHPerformance *)itemData;
|
|
|
perfms.net = self.currentStatus.net;
|
|
|
if (perfms) {
|
|
|
[self.immediUploadItemDic setObject:[[NSMutableArray alloc]initWithObjects:perfms.jsonDictionary, nil] forKey:JsonKeyDataTypePerfor];
|
|
|
|
|
|
[[YHNetworkService sharedInstance] uploadLogData:self.immediUploadItemDic completionBlock:^(BOOL success, NSError *error) {
|
|
|
if (success) {
|
|
|
YALog(@"upload immedialite event success.");
|
|
|
} else {
|
|
|
YALog(@"uploadImmedilyWithEvent error = %@", error.localizedDescription);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
} else if(itemData.dataType == YHItemDataTypeError) {
|
|
|
YHError *error = (YHError *)itemData;
|
|
|
if (error) {
|
...
|
...
|
@@ -604,6 +620,7 @@ static dispatch_queue_t persisting_queue() { |
|
|
|
|
|
- (BOOL)writePerformanceToFile:(YHPerformance *)performanceData
|
|
|
{
|
|
|
performanceData.net = self.currentStatus.net;
|
|
|
if (performanceData == nil || ![performanceData isKindOfClass:[YHPerformance class]]) {
|
|
|
NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException
|
|
|
reason:@"The input parameter is nil or an unexpected value."
|
...
|
...
|
|