Skip to content

Commit

Permalink
fix: 408 status retry counter
Browse files Browse the repository at this point in the history
- Fixed DRL status fail counter decreased in case of HTTP 408 error
  • Loading branch information
Fehniix committed Jan 25, 2022
1 parent 6cd51e0 commit 11f181a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions DGCAVerifier/Services/CRLSynchronizationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class CRLSynchronizationManager {
delegate?.statusDidChange(with: .completed)
}

func handleRetry(){
CRLSynchronizationManager.shared.crlFailCounter -= 1
if CRLSynchronizationManager.shared.crlFailCounter < 0 {
func handleRetry() {
self.crlFailCounter -= 1
if self.crlFailCounter < 0 {
log("failed too many times")
if progress.remainingSize == "0.00" || progress.remainingSize == "" {
delegate?.statusDidChange(with: .statusNetworkError)
Expand All @@ -178,13 +178,14 @@ class CRLSynchronizationManager {
}
}

func handleStatusRetry(responseCode: Int?){
self.crlStatusFailCounter -= 1
func handleStatusRetry(responseCode: Int?) {
if responseCode != 408 {
self.crlStatusFailCounter -= 1
}

if self.crlStatusFailCounter < 0 || !Connectivity.isOnline || responseCode == 408 {
self.delegate?.statusDidChange(with: .statusNetworkError)
}
else {
} else {
self.cleanAndRetry()
}
}
Expand Down

0 comments on commit 11f181a

Please sign in to comment.