Create async wrapper for update(feed, parsedFeed) method.

This commit is contained in:
Brent Simmons committed 2025-10-17 22:38:06 -07:00
1 parent 3ff09d71cc
commit cf9a0966ae
1 file changed
+13
@@ -716,6 +716,19 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
webFeedDictionariesNeedUpdate = true
}
@MainActor func update(_ feed: WebFeed, with parsedFeed: ParsedFeed) async throws -> ArticleChanges {
try await withCheckedThrowingContinuation { continuation in
update(feed, with: parsedFeed) { result in
switch result {
case .success(let articleChanges):
continuation.resume(returning: articleChanges)
case .failure(let error):
continuation.resume(throwing: error)
}
}
}
}
func update(_ webFeed: WebFeed, with parsedFeed: ParsedFeed, _ completion: @escaping UpdateArticlesCompletionBlock) {
// Used only by an On My Mac or iCloud account.
precondition(Thread.isMainThread)