|
|
|
|
@ -199,7 +199,7 @@ actor ApiCallCollection<T: SyncedStorable>: SomeCallCollection { |
|
|
|
|
if T.copyServerResponse { |
|
|
|
|
StoreCenter.main.updateLocalInstances(results) |
|
|
|
|
} |
|
|
|
|
self._attemptLoops = -1 |
|
|
|
|
// self._attemptLoops = -1 |
|
|
|
|
} |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
@ -217,8 +217,12 @@ actor ApiCallCollection<T: SyncedStorable>: SomeCallCollection { |
|
|
|
|
/// Wait for an exponentionnaly long time depending on the number of attemps |
|
|
|
|
fileprivate func _wait() async { |
|
|
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
|
let seconds = 2 * self._attemptLoops |
|
|
|
|
#else |
|
|
|
|
let delay = pow(2, self._attemptLoops) |
|
|
|
|
let seconds = NSDecimalNumber(decimal: delay).intValue |
|
|
|
|
#endif |
|
|
|
|
Logger.log("\(T.resourceName()): wait for \(seconds) sec") |
|
|
|
|
do { |
|
|
|
|
try await Task.sleep(until: .now + .seconds(seconds)) |
|
|
|
|
|