diff --git a/LeStorage/ApiCallCollection.swift b/LeStorage/ApiCallCollection.swift index 9cc81b3..1886c64 100644 --- a/LeStorage/ApiCallCollection.swift +++ b/LeStorage/ApiCallCollection.swift @@ -161,6 +161,11 @@ actor ApiCallCollection: SomeCallCollection { } } + func rescheduleImmediately() { + self._attemptLoops = -1 + self.rescheduleApiCallsIfNecessary() + } + /// Reschedule API calls if necessary func rescheduleApiCallsIfNecessary() { if self.items.isNotEmpty && !self._isRescheduling { diff --git a/LeStorage/StoreCenter.swift b/LeStorage/StoreCenter.swift index 0b9973f..6154cd7 100644 --- a/LeStorage/StoreCenter.swift +++ b/LeStorage/StoreCenter.swift @@ -129,7 +129,7 @@ public class StoreCenter { } @objc fileprivate func _willEnterForegroundNotification() { - Logger.log("_willEnterForegroundNotification") +// Logger.log("_willEnterForegroundNotification") self._launchSynchronization() } @@ -464,7 +464,7 @@ public class StoreCenter { let syncGetCollection: ApiCallCollection = try self.apiCallCollection() if await syncGetCollection.hasPendingCalls() { - await syncGetCollection.rescheduleApiCallsIfNecessary() + await syncGetCollection.rescheduleImmediately() } else { let getSyncData = GetSyncData() getSyncData.lastUpdate = lastSync