@@ -206,7 +206,6 @@ pub async fn process_events(
206
206
loop {
207
207
log:: info!( "Reading events ..." ) ;
208
208
let event = client. acquire_receiver ( ) . unwrap ( ) . receive ( ) . await ;
209
- log:: info!( "!!! RECEIVED {event:#?}" ) ;
210
209
match event {
211
210
SessionEvent :: StateChange {
212
211
new_state : ConnectionState :: Connected ,
@@ -217,25 +216,27 @@ pub async fn process_events(
217
216
}
218
217
SessionEvent :: ReceiveText { text } => {
219
218
let request: serde_json:: Result < CommandRequest > = serde_json:: from_str ( & text) ;
220
- log:: info!( "Processing request {:?}" , request) ;
221
219
match request {
222
- Ok ( request) => processor. as_mut ( ) . unwrap ( ) . process (
223
- & request,
224
- |response : CommandResponse | match response. response {
225
- FetchFileChunk { .. } => client
226
- . send (
227
- FrameType :: Binary ( false ) ,
228
- & rmp_serde:: to_vec ( & response) . unwrap ( ) ,
229
- )
230
- . unwrap ( ) ,
231
- _ => client
232
- . send (
233
- FrameType :: Text ( false ) ,
234
- serde_json:: to_string ( & response) . unwrap ( ) . as_bytes ( ) ,
235
- )
236
- . unwrap ( ) ,
237
- } ,
238
- ) ,
220
+ Ok ( request) => {
221
+ log:: info!( "Processing request {:?}" , request) ;
222
+ processor. as_mut ( ) . unwrap ( ) . process (
223
+ & request,
224
+ |response : CommandResponse | match response. response {
225
+ FetchFileChunk { .. } => client
226
+ . send (
227
+ FrameType :: Binary ( false ) ,
228
+ & rmp_serde:: to_vec ( & response) . unwrap ( ) ,
229
+ )
230
+ . unwrap ( ) ,
231
+ _ => client
232
+ . send (
233
+ FrameType :: Text ( false ) ,
234
+ serde_json:: to_string ( & response) . unwrap ( ) . as_bytes ( ) ,
235
+ )
236
+ . unwrap ( ) ,
237
+ } ,
238
+ )
239
+ }
239
240
Err ( error) => {
240
241
log:: error!( "Failed to parse payload with error: {error}" )
241
242
}
0 commit comments