瀏覽代碼

1.提交日志卡住主线程问题

huangxiaodong 10 月之前
父節點
當前提交
9787c7364e

+ 1 - 1
创维盒子/code/netWork/addLog/addLogObject.m

@@ -106,7 +106,7 @@ static addLogObject *addlog_ShareInstance = nil;
     
     [paraDict setValue:filename forKey:@"filename"];
     [paraDict setValue:@7 forKey:@"days"];
-    
+    HLog(@"hxd 222222");
     KWeakSelf
     [[netWorkManager shareInstance] doUploadFileToFileServiceWithParams:paraDict data:logData success:^(id  _Nonnull responseObject) {
         HLog(@"%@",responseObject);

+ 12 - 8
创维盒子/code/webRtc/webRtcManager/webRtcManager.m

@@ -76,10 +76,11 @@
             if(tryRelinkNum == 2){
                 _didReportWebRtcFailType = YES;
                 KWeakSelf
-                [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
-                    [weakSelf reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcChannelSessionId withLogKey:key];
-                }];
-                
+                globalBlock(^{
+                    [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
+                        [weakSelf reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcChannelSessionId withLogKey:key];
+                    }];
+                });
                 //检测盒子心跳
                 [self checkBoxHeartbeatFun];
             }
@@ -977,12 +978,15 @@
         case RTCIceConnectionStateFailed:
         case RTCIceConnectionStateDisconnected:
         case RTCIceConnectionStateClosed:{
-            if(!_didReportWebRtcFailType && state != RTCIceConnectionStateDisconnected){//还没上报过通道链接情况
+            if(!_didReportWebRtcFailType && state == RTCIceConnectionStateFailed){//还没上报过通道链接情况
                 _didReportWebRtcFailType = YES;
                 KWeakSelf
-                [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
-                    [weakSelf reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcChannelSessionId withLogKey:key];
-                }];
+                globalBlock(^{
+                    [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
+                        [weakSelf reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcChannelSessionId withLogKey:key];
+                    }];
+                });
+                
             }
             //链接关闭
             [self relinkWebRtcFun];

+ 11 - 8
创维盒子/code/webRtc/webRtcPlayerViewController.m

@@ -428,9 +428,11 @@
                     tryRelinkNum = 0;
                     _didReportWebRtcFailType = YES;
                     
-                    [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
-                        [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcPlayerSessionId withLogKey:key];
-                    }];
+                    globalBlock(^{
+                        [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
+                            [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcPlayerSessionId withLogKey:key];
+                        }];
+                    });
                     
                     
                     //[self showLinkPhoneErrorFun];
@@ -1165,12 +1167,13 @@
         case RTCIceConnectionStateFailed:
         case RTCIceConnectionStateDisconnected:
         case RTCIceConnectionStateClosed:{
-            if(!_didReportWebRtcFailType && state != RTCIceConnectionStateDisconnected){//还没上报过通道链接情况
+            if(!_didReportWebRtcFailType && state == RTCIceConnectionStateFailed){//还没上报过通道链接情况
                 _didReportWebRtcFailType  = YES;
-               
-                [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
-                    [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcPlayerSessionId withLogKey:key];
-                }];
+                globalBlock(^{
+                    [[addLogObject shareInstance] gotoAddLogFunBySuccess:^(NSString * _Nonnull key) {
+                        [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:self->_webRtcPlayerSessionId withLogKey:key];
+                    }];
+                });
             }
             //链接关闭
             [self relinkWebRtcFun];