Skip to content

Commit

Permalink
chore: add check for self in timeout wrapper
Browse files Browse the repository at this point in the history
Co-authored-by: Ehab Al <[email protected]>
  • Loading branch information
precious-ossai-cko and ehab-al-cko authored Jul 10, 2024
1 parent 457a94e commit c67257e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Risk/Risk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public final class Risk {

DispatchQueue.main.async {
// Timer setup remains on the main queue
self.timer = Timer.scheduledTimer(withTimeInterval: self.fingerprintTimeoutInterval, repeats: false) { _ in // 3.00
self.timer = Timer.scheduledTimer(withTimeInterval: self.fingerprintTimeoutInterval, repeats: false) { [weak self] _ in // 3.00
guard let self else { return }

self.loggerService.log(riskEvent: .publishFailure, blockTime: self.blockTime, deviceDataPersistTime: nil, fpLoadTime: fingerprintService.fpLoadTime, fpPublishTime: nil, deviceSessionId: nil, requestId: nil, error: RiskLogError(reason: "publishData", message: RiskError.Publish.fingerprintTimeout.localizedDescription, status: nil, type: "Timeout"))
completion(.failure(.fingerprintTimeout))
Expand Down

0 comments on commit c67257e

Please sign in to comment.