@@ -75,11 +75,7 @@ - (instancetype)init;
75
75
_logDistributingQueue.name = [NSString stringWithFormat: @" %@ Log Distributing Queue" , self ];
76
76
_logDistributingQueue.maxConcurrentOperationCount = 1 ;
77
77
78
- #ifdef __IPHONE_8_0
79
- if ([_logDistributingQueue respondsToSelector: @selector (setQualityOfService: )] /* iOS 8 or later */ ) {
80
- _logDistributingQueue.qualityOfService = NSQualityOfServiceBackground ;
81
- }
82
- #endif
78
+ [self _setDistributionQualityOfServiceBackground ];
83
79
84
80
_logObservers = [NSMutableArray new ];
85
81
@@ -191,8 +187,10 @@ - (void)distributeAllPendingLogsWithCompletionHandler:(dispatch_block_t)completi
191
187
{
192
188
ARKCheckCondition (completionHandler != NULL , , @" Must provide a completion handler!" );
193
189
190
+ [self _setDistributionQualityOfServiceUserInitiated ];
194
191
[self .logDistributingQueue addOperationWithBlock: ^{
195
192
[[NSOperationQueue mainQueue ] addOperationWithBlock: completionHandler];
193
+ [self _setDistributionQualityOfServiceBackground ];
196
194
}];
197
195
}
198
196
@@ -284,4 +282,29 @@ - (void)_logMessage_inLogDistributingQueue:(ARKLogMessage *)logMessage;
284
282
}
285
283
}
286
284
285
+ - (void )_setDistributionQualityOfServiceUserInitiated ;
286
+ {
287
+ #ifdef __IPHONE_8_0
288
+ [self _setDistributionQualityOfService: NSQualityOfServiceUserInitiated ];
289
+ #endif
290
+ }
291
+
292
+ - (void )_setDistributionQualityOfServiceBackground ;
293
+ {
294
+ #ifdef __IPHONE_8_0
295
+ [self _setDistributionQualityOfService: NSQualityOfServiceBackground ];
296
+ #endif
297
+ }
298
+
299
+ #ifdef __IPHONE_8_0
300
+
301
+ - (void )_setDistributionQualityOfService : (NSQualityOfService )qualityOfService ;
302
+ {
303
+ if ([self .logDistributingQueue respondsToSelector: @selector (setQualityOfService: )] /* iOS 8 or later */ ) {
304
+ self.logDistributingQueue .qualityOfService = qualityOfService;
305
+ }
306
+ }
307
+
308
+ #endif
309
+
287
310
@end
0 commit comments