@@ -69,17 +69,6 @@ fn cancel_if_instance(slot: &mut Option<SidecarInterfaceRequest>, instance_id: &
6969 }
7070}
7171
72- fn cancel_if_session ( slot : & mut Option < SidecarInterfaceRequest > , session_id : & str ) {
73- let should_cancel = match slot {
74- Some ( SidecarInterfaceRequest :: SetSessionConfig { session_id : id, .. } ) => {
75- id. as_str ( ) == session_id
76- }
77- _ => false ,
78- } ;
79- if should_cancel {
80- * slot = None ;
81- }
82- }
8372
8473fn cancel_if_queue (
8574 slot : & mut Option < SidecarInterfaceRequest > ,
@@ -109,8 +98,8 @@ fn coalesce(outbox: &mut SidecarOutbox, incoming: SidecarInterfaceRequest) {
10998 cancel_if_instance ( & mut outbox. set_request_config , instance_id) ;
11099 cancel_if_instance ( & mut outbox. set_universal_service_tags , instance_id) ;
111100 }
112- if let SidecarInterfaceRequest :: ShutdownSession { ref session_id } = incoming {
113- cancel_if_session ( & mut outbox. set_session_config , session_id ) ;
101+ if matches ! ( incoming , SidecarInterfaceRequest :: ShutdownSession { } ) {
102+ outbox. set_session_config = None ;
114103 }
115104 if let SidecarInterfaceRequest :: ClearQueueId {
116105 ref instance_id,
@@ -231,13 +220,10 @@ impl SidecarSender {
231220 self . try_drain_outbox ( ) ;
232221 }
233222
234- pub fn set_session_process_tags ( & mut self , session_id : String , process_tags : String ) {
223+ pub fn set_session_process_tags ( & mut self , process_tags : String ) {
235224 coalesce (
236225 & mut self . outbox ,
237- SidecarInterfaceRequest :: SetSessionProcessTags {
238- session_id,
239- process_tags,
240- } ,
226+ SidecarInterfaceRequest :: SetSessionProcessTags { process_tags } ,
241227 ) ;
242228 self . try_drain_outbox ( ) ;
243229 }
@@ -318,10 +304,10 @@ impl SidecarSender {
318304 self . try_drain_outbox ( ) ;
319305 }
320306
321- pub fn shutdown_session ( & mut self , session_id : String ) {
307+ pub fn shutdown_session ( & mut self ) {
322308 coalesce (
323309 & mut self . outbox ,
324- SidecarInterfaceRequest :: ShutdownSession { session_id } ,
310+ SidecarInterfaceRequest :: ShutdownSession { } ,
325311 ) ;
326312 self . try_drain_outbox ( ) ;
327313 }
@@ -428,12 +414,11 @@ impl SidecarSender {
428414 . try_send_send_dogstatsd_actions ( instance_id, actions) ;
429415 }
430416
431- pub fn set_test_session_token ( & mut self , session_id : String , token : String ) {
417+ pub fn set_test_session_token ( & mut self , token : String ) {
432418 if !self . try_drain_outbox ( ) {
433419 return ;
434420 }
435- self . channel
436- . try_send_set_test_session_token ( session_id, token) ;
421+ self . channel . try_send_set_test_session_token ( token) ;
437422 }
438423
439424 pub fn set_read_timeout ( & mut self , d : Option < Duration > ) -> io:: Result < ( ) > {
0 commit comments