File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ exclude = [
1717chrono = " 0.4.19"
1818crossbeam-channel = " 0.5.1"
1919data-encoding = " 2.3.2"
20- eventsource-client = { version = " 0.12.2 " , default-features = false }
20+ eventsource-client = { version = " 0.13.0 " , default-features = false }
2121futures = " 0.3.12"
2222lazy_static = " 1.4.0"
2323log = " 0.4.14"
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments