Skip to content

Commit

Permalink
Merge pull request #590 from cranberyxl/fix/too-many-timers
Browse files Browse the repository at this point in the history
[AuthManager] clear token refresh timer
  • Loading branch information
roninopf committed Feb 10, 2023
2 parents f699938 + feb8e56 commit 4cb59a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions swift-sdk/Internal/AuthManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class AuthManager: IterableAuthManagerProtocol {

let timeIntervalToRefresh = TimeInterval(expirationDate) - dateProvider.currentDate.timeIntervalSince1970 - expirationRefreshPeriod

clearRefreshTimer()
expirationRefreshTimer = Timer.scheduledTimer(withTimeInterval: timeIntervalToRefresh, repeats: false) { [weak self] _ in
self?.requestNewAuthToken(hasFailedPriorAuth: false)
}
Expand Down

0 comments on commit 4cb59a0

Please sign in to comment.