Skip to content

Commit

Permalink
added retry count resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
Recouse committed Apr 5, 2023
1 parent ee4ac4d commit 5c45d96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/EventSource/EventSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ public final class EventSource {

// Stop connection when 204 response code, otherwise keep open
if httpResponse.statusCode != 204, 200...299 ~= httpResponse.statusCode {
// Reset current retries count to allow retry on the next error
currentRetryCount = 0

if readyState != .open {
await setOpen()
}
Expand Down

0 comments on commit 5c45d96

Please sign in to comment.