|
|
@ -40,6 +40,9 @@ class ProfileFetcherJob: NSObject {
|
|
|
|
|
|
|
|
|
|
|
|
public func getProfile(recipientId: String, remainingRetries: Int = 3) {
|
|
|
|
public func getProfile(recipientId: String, remainingRetries: Int = 3) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only throttle profile fetch in production builds in order to
|
|
|
|
|
|
|
|
// facilitate debugging.
|
|
|
|
|
|
|
|
if !_isDebugAssertConfiguration() {
|
|
|
|
if let lastDate = ProfileFetcherJob.fetchDateMap[recipientId] {
|
|
|
|
if let lastDate = ProfileFetcherJob.fetchDateMap[recipientId] {
|
|
|
|
let lastTimeInterval = fabs(lastDate.timeIntervalSinceNow)
|
|
|
|
let lastTimeInterval = fabs(lastDate.timeIntervalSinceNow)
|
|
|
|
// Don't check a profile more often than every N minutes.
|
|
|
|
// Don't check a profile more often than every N minutes.
|
|
|
@ -50,6 +53,7 @@ class ProfileFetcherJob: NSObject {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ProfileFetcherJob.fetchDateMap[recipientId] = Date()
|
|
|
|
ProfileFetcherJob.fetchDateMap[recipientId] = Date()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Logger.error("\(self.TAG) getProfile: \(recipientId)")
|
|
|
|
Logger.error("\(self.TAG) getProfile: \(recipientId)")
|
|
|
|
|
|
|
|
|
|
|
|