diff --git a/Account/Sources/Account/AccountManager.swift b/Account/Sources/Account/AccountManager.swift index 836cf0603..fbf5fa32c 100644 --- a/Account/Sources/Account/AccountManager.swift +++ b/Account/Sources/Account/AccountManager.swift @@ -268,34 +268,6 @@ public final class AccountManager: UnreadCountProvider { } } - public func refreshAll(completion: (() -> Void)? = nil) { - guard let reachability = try? Reachability(hostname: "apple.com"), reachability.connection != .unavailable else { return } - - var syncErrors = [AccountSyncError]() - let group = DispatchGroup() - - activeAccounts.forEach { account in - group.enter() - account.refreshAll() { result in - group.leave() - switch result { - case .success: - break - case .failure(let error): - syncErrors.append(AccountSyncError(account: account, error: error)) - } - } - } - - group.notify(queue: DispatchQueue.main) { - if syncErrors.count > 0 { - NotificationCenter.default.post(Notification(name: .AccountsDidFailToSyncWithErrors, object: self, userInfo: [Account.UserInfoKey.syncErrors: syncErrors])) - } - completion?() - } - - } - public func sendArticleStatusAll(completion: (() -> Void)? = nil) { let group = DispatchGroup() diff --git a/Account/Sources/Account/AccountSyncError.swift b/Account/Sources/Account/AccountSyncError.swift deleted file mode 100644 index 6f7148700..000000000 --- a/Account/Sources/Account/AccountSyncError.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// AccountSyncError.swift -// Account -// -// Created by Stuart Breckenridge on 24/7/20. -// Copyright © 2020 Ranchero Software, LLC. All rights reserved. -// - -import Foundation -import RSCore - -public extension Notification.Name { - static let AccountsDidFailToSyncWithErrors = Notification.Name("AccountsDidFailToSyncWithErrors") -} - -public struct AccountSyncError: Logging { - - public let account: Account - public let error: Error - - init(account: Account, error: Error) { - self.account = account - self.error = error - AccountSyncError.logger.error("Account Sync Error: \(error.localizedDescription, privacy: .public)") - } - -} -