Skip to content

Commit

Permalink
rename delayBlock parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
Enricoza committed Feb 10, 2025
1 parent dd764e7 commit 0a72778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import XCTest
@testable import TealiumCore

class NoDelayRetriever<T: Codable>: ResourceRetriever<T> {
override func delayBlock(count: Int, _ block: @escaping () -> Void) {
override func delayBlock(delayMultiplier: Double, _ block: @escaping () -> Void) {
block()
}
}
Expand Down
6 changes: 3 additions & 3 deletions tealium/core/utils/network/ResourceRetriever.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public class ResourceRetriever<Resource: Codable> {
}
}

func delayBlock(count: Int, _ block: @escaping () -> Void) {
TealiumQueues.backgroundSerialQueue.asyncAfter(deadline: .now() + retryDelay * Double(count)) {
func delayBlock(delayMultiplier: Double, _ block: @escaping () -> Void) {
TealiumQueues.backgroundSerialQueue.asyncAfter(deadline: .now() + retryDelay * delayMultiplier) {
block()
}
}
Expand All @@ -85,7 +85,7 @@ public class ResourceRetriever<Resource: Codable> {
if case .failure(let error) = result {
if self.isRetryableError(error) && retryCount < self.maxRetries {
let newCount = retryCount + 1
self.delayBlock(count: newCount) { [weak self] in
self.delayBlock(delayMultiplier: Double(newCount)) { [weak self] in
self?.sendRetryableRequest(request, retryCount: newCount, completion: completion)
}
return
Expand Down

0 comments on commit 0a72778

Please sign in to comment.