Skip to content

Commit f42c302

Browse files
committed
fix uplog fail
1 parent eea8351 commit f42c302

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

QiniuSDK/Collect/QNReportConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (instancetype)init {
2626
if (self) {
2727
_reportEnable = YES;
2828
_interval = 10;
29-
_serverURL = @"https://uplog.qbox.me/log/4";
29+
_serverURL = @"https://uplog.qbox.me/log/4?compressed=gzip";
3030
_recordDirectory = [NSString stringWithFormat:@"%@/report", [QNUtils sdkCacheDirectory]];
3131
_maxRecordFileSize = 2 * 1024 * 1024;
3232
_uploadThreshold = 4 * 1024;

QiniuSDK/Collect/QNUploadInfoReporter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ - (void)innerReport:(NSString *)jsonString token:(NSString *)token {
126126
}
127127
}
128128

129-
// 判断是否满足上传条件:文件大于上报临界值 && (首次上传 || 距上次上传时间大于_config.interval)
129+
// 判断是否满足上传条件:文件大于上报临界值 || (首次上传 || 距上次上传时间大于_config.interval)
130130
NSTimeInterval currentTime = [[NSDate dateWithTimeIntervalSinceNow:0] timeIntervalSince1970];
131-
if (file.size > _config.uploadThreshold && (_lastReportTime == 0 || currentTime - _lastReportTime > _config.interval * 60)) {
131+
if (file.size > _config.uploadThreshold || (_lastReportTime == 0 || currentTime - _lastReportTime > _config.interval * 60)) {
132132

133133
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:_config.serverURL]];
134134
[request setValue:[NSString stringWithFormat:@"UpToken %@", token] forHTTPHeaderField:@"Authorization"];

0 commit comments

Comments
 (0)