Skip to content

Commit

Permalink
chore: Bump eventsource client (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 authored Jul 30, 2024
1 parent a9c0150 commit 963a75c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion launchdarkly-server-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = [
chrono = "0.4.19"
crossbeam-channel = "0.5.1"
data-encoding = "2.3.2"
eventsource-client = { version = "0.12.2", default-features = false }
eventsource-client = { version = "0.13.0", default-features = false }
futures = "0.3.12"
lazy_static = "1.4.0"
log = "0.4.14"
Expand Down
10 changes: 7 additions & 3 deletions launchdarkly-server-sdk/src/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,22 @@ impl DataSource for StreamingDataSource {
event = event_stream.next() => {
let event = match event {
Some(Ok(event)) => match event {
es::SSE::Connected(_) => {
debug!("data source connected");
continue;
},
es::SSE::Comment(str)=> {
debug!("data source got a comment: {}", str);
continue;
},
es::SSE::Event(ev) => ev,
},
Some(Err(es::Error::UnexpectedResponse(status_code))) => {
match is_http_error_recoverable(status_code.as_u16()) {
Some(Err(es::Error::UnexpectedResponse(response, _))) => {
match is_http_error_recoverable(response.status()) {
true => continue,
_ => {
notify_init.call_once(|| (init_complete)(false));
warn!("Returned unrecoverable failure. Unexpected response {:?}", status_code);
warn!("Returned unrecoverable failure. Unexpected response {}", response.status());
break
}
}
Expand Down

0 comments on commit 963a75c

Please sign in to comment.