|
|
@@ -19,7 +19,6 @@
|
|
|
//正在下载的上传地址数组
|
|
|
@property(nonatomic,strong) NSMutableArray *uploadingOperationArr;
|
|
|
|
|
|
-@property(nonatomic,assign) NSInteger speedShowCount;//内网的情况 多少次才刷新一次
|
|
|
@end
|
|
|
|
|
|
@implementation nasMixUploadManager
|
|
|
@@ -37,13 +36,6 @@
|
|
|
if (self = [super init]) {
|
|
|
_maxUploadLoadCount = 2;
|
|
|
|
|
|
- if ([connectDeviceManager shareInstance].isPingOk)
|
|
|
- {
|
|
|
- _speedShowCount = 3;
|
|
|
- }
|
|
|
- else{
|
|
|
- _speedShowCount = 0;
|
|
|
- }
|
|
|
//[self registeNotification];
|
|
|
}
|
|
|
return self;
|
|
|
@@ -753,10 +745,16 @@ didReceiveResponse:(NSURLResponse *)response
|
|
|
operation.fileModel.didUploadBytes -= (totalBytesExpectedToSend - operation.onceDataLengt);
|
|
|
}
|
|
|
|
|
|
- operation.i ++;
|
|
|
- if(operation.i >= _speedShowCount){
|
|
|
+ NSTimeInterval curTime = [[NSDate date] timeIntervalSince1970];
|
|
|
+ NSTimeInterval timeDiff = curTime - operation.preNotTimeInterval;
|
|
|
+
|
|
|
+ HLog(@"控制刷新时间为1秒:%f",timeDiff);
|
|
|
+
|
|
|
+ if (operation.preNotTimeInterval <= 0
|
|
|
+ || timeDiff > 0.8 ) {
|
|
|
+
|
|
|
+ operation.preNotTimeInterval = curTime;
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:uploadFileRefreshNotification object:operation.fileModel];
|
|
|
- operation.i = 0;
|
|
|
}
|
|
|
|
|
|
break;
|