Skip to content

Commit a9c0150

Browse files
authored
fix: Allow event retries even if initial request fails to connect (#93)
1 parent 8b5e18e commit a9c0150

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

launchdarkly-server-sdk/src/events/sender.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ where
107107
}
108108
};
109109

110-
for attempt in 0..2 {
111-
if attempt == 1 {
110+
for attempt in 1..=2 {
111+
if attempt == 2 {
112112
sleep(Duration::from_secs(1)).await;
113113
}
114114

@@ -134,6 +134,7 @@ where
134134

135135
let response = match result {
136136
Ok(response) => response,
137+
Err(_) if attempt == 1 => continue,
137138
Err(e) => {
138139
// It appears this type of error will not be an HTTP error.
139140
// It will be a closed connection, aborted write, timeout, etc.

0 commit comments

Comments
 (0)