From 13d0e739fbb36f9e99e3cdb8ca29256894f9e359 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 11 Mar 2020 11:54:10 +0800 Subject: [PATCH] Update the coderQueue QoS based on SDWebImageDownloaderLowPriority && SDWebImageDownloaderHighPriority --- SDWebImage/Core/SDWebImageDownloaderOperation.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SDWebImage/Core/SDWebImageDownloaderOperation.m b/SDWebImage/Core/SDWebImageDownloaderOperation.m index 1de8212a..00d803f2 100644 --- a/SDWebImage/Core/SDWebImageDownloaderOperation.m +++ b/SDWebImage/Core/SDWebImageDownloaderOperation.m @@ -208,8 +208,13 @@ typedef NSMutableDictionary SDCallbacksDictionary; if (self.dataTask) { if (self.options & SDWebImageDownloaderHighPriority) { self.dataTask.priority = NSURLSessionTaskPriorityHigh; + self.coderQueue.qualityOfService = NSQualityOfServiceUserInteractive; } else if (self.options & SDWebImageDownloaderLowPriority) { self.dataTask.priority = NSURLSessionTaskPriorityLow; + self.coderQueue.qualityOfService = NSQualityOfServiceBackground; + } else { + self.dataTask.priority = NSURLSessionTaskPriorityDefault; + self.coderQueue.qualityOfService = NSQualityOfServiceDefault; } [self.dataTask resume]; for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) {