Avoid a potential hang by calling the previous completion before setting a new one.

This commit is contained in:
Brent Simmons committed 2026-08-31 07:17:27 -07:00
1 parent 3ffd90ff2b
commit 4544328042
1 file changed
+5
@@ -143,6 +143,11 @@ import os
let urls = filteredFeeds.compactMap { Self.url(for: $0) }
// This refresh replaces any in-flight one, so resume its caller rather than stranding it.
if let previousCompletion = self.completion {
previousCompletion()
}
self.completion = completion
downloadSession.download(Set(urls))
}