Switch from download to downloadUsingCache where appropriate.

This commit is contained in:
Brent Simmons 2017-11-23 10:29:00 -08:00
parent c9610f1f8e
commit b4ff1785ab
4 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ private extension FaviconDownloader {
urlsBeingDownloaded.insert(faviconURL) urlsBeingDownloaded.insert(faviconURL)
download(url) { (data, response, error) in downloadUsingCache(url) { (data, response, error) in
self.urlsBeingDownloaded.remove(faviconURL) self.urlsBeingDownloaded.remove(faviconURL)
if response == nil || !response!.statusIsOK { if response == nil || !response!.statusIsOK {

View File

@ -21,7 +21,7 @@ struct FaviconURLFinder {
return return
} }
download(url) { (data, response, error) in downloadUsingCache(url) { (data, response, error) in
guard let data = data, let response = response, response.statusIsOK else { guard let data = data, let response = response, response.statusIsOK else {
callback(nil) callback(nil)

View File

@ -12,7 +12,7 @@ import RSWeb
func downloadTitleForFeed(_ url: URL, _ completionHandler: @escaping (_ title: String?) -> ()) { func downloadTitleForFeed(_ url: URL, _ completionHandler: @escaping (_ title: String?) -> ()) {
download(url) { (data, response, error) in downloadUsingCache(url) { (data, response, error) in
guard let data = data else { guard let data = data else {
completionHandler(nil) completionHandler(nil)

View File

@ -124,7 +124,7 @@ private extension FeedFinder {
func downloadInitialFeed(_ initialURL: URL) { func downloadInitialFeed(_ initialURL: URL) {
download(initialURL) { (data, response, error) in downloadUsingCache(initialURL) { (data, response, error) in
self.initialDownloadStatusCode = response?.forcedStatusCode ?? -1 self.initialDownloadStatusCode = response?.forcedStatusCode ?? -1
@ -170,7 +170,7 @@ private extension FeedFinder {
continue continue
} }
download(url) { (data, response, error) in downloadUsingCache(url) { (data, response, error) in
pendingDownloads.remove(oneFeedSpecifier) pendingDownloads.remove(oneFeedSpecifier)