Skip to content

Commit 963a75c

Browse files
authored
chore: Bump eventsource client (#95)
1 parent a9c0150 commit 963a75c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

launchdarkly-server-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exclude = [
1717
chrono = "0.4.19"
1818
crossbeam-channel = "0.5.1"
1919
data-encoding = "2.3.2"
20-
eventsource-client = { version = "0.12.2", default-features = false }
20+
eventsource-client = { version = "0.13.0", default-features = false }
2121
futures = "0.3.12"
2222
lazy_static = "1.4.0"
2323
log = "0.4.14"

launchdarkly-server-sdk/src/data_source.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,22 @@ impl DataSource for StreamingDataSource {
131131
event = event_stream.next() => {
132132
let event = match event {
133133
Some(Ok(event)) => match event {
134+
es::SSE::Connected(_) => {
135+
debug!("data source connected");
136+
continue;
137+
},
134138
es::SSE::Comment(str)=> {
135139
debug!("data source got a comment: {}", str);
136140
continue;
137141
},
138142
es::SSE::Event(ev) => ev,
139143
},
140-
Some(Err(es::Error::UnexpectedResponse(status_code))) => {
141-
match is_http_error_recoverable(status_code.as_u16()) {
144+
Some(Err(es::Error::UnexpectedResponse(response, _))) => {
145+
match is_http_error_recoverable(response.status()) {
142146
true => continue,
143147
_ => {
144148
notify_init.call_once(|| (init_complete)(false));
145-
warn!("Returned unrecoverable failure. Unexpected response {:?}", status_code);
149+
warn!("Returned unrecoverable failure. Unexpected response {}", response.status());
146150
break
147151
}
148152
}

0 commit comments

Comments
 (0)