diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionProcessor.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionProcessor.swift index 5bb320d3d1..4e0cf5ac7d 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionProcessor.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionProcessor.swift @@ -70,10 +70,11 @@ final class DataBrokerProtectionProcessor { currentlyRunningOperationsForFunction = .startManualScans(pendingCompletion: completion) runOperations(operationType: .scan, priorityDate: nil, - showWebView: showWebView) { errors in + showWebView: showWebView) { [weak self] errors in os_log("Scans done", log: .dataBrokerProtection) + self?.currentlyRunningOperationsForFunction = nil completion?(errors) - self.calculateMisMatches() + self?.calculateMisMatches() } } @@ -88,8 +89,9 @@ final class DataBrokerProtectionProcessor { currentlyRunningOperationsForFunction = .runAllOptOutOperations(pendingCompletion: completion) runOperations(operationType: .optOut, priorityDate: nil, - showWebView: showWebView) { errors in + showWebView: showWebView) { [weak self] errors in os_log("Optouts done", log: .dataBrokerProtection) + self?.currentlyRunningOperationsForFunction = nil completion?(errors) } } @@ -100,8 +102,9 @@ final class DataBrokerProtectionProcessor { currentlyRunningOperationsForFunction = .runQueuedOperations(pendingCompletion: completion) runOperations(operationType: .all, priorityDate: Date(), - showWebView: showWebView) { errors in + showWebView: showWebView) { [weak self] errors in os_log("Queued operations done", log: .dataBrokerProtection) + self?.currentlyRunningOperationsForFunction = nil completion?(errors) } } @@ -112,8 +115,9 @@ final class DataBrokerProtectionProcessor { currentlyRunningOperationsForFunction = .runAllOperations(pendingCompletion: completion) runOperations(operationType: .all, priorityDate: nil, - showWebView: showWebView) { errors in + showWebView: showWebView) { [weak self] errors in os_log("Queued operations done", log: .dataBrokerProtection) + self?.currentlyRunningOperationsForFunction = nil completion?(errors) } }