File tree 1 file changed +20
-6
lines changed
1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -789,14 +789,28 @@ def process_message(self, message):
789
789
self .consumer .send_message (message .response (response ))
790
790
791
791
def on_pause (self , msg ):
792
- proc = psutil .Process (self .application_process .pid )
793
- proc .suspend ()
794
- self .pause_sim ()
792
+ if self .application_process is not None :
793
+ try :
794
+ proc = psutil .Process (self .application_process .pid )
795
+ proc .suspend ()
796
+ self .pause_sim ()
797
+ except Exception as e :
798
+ LogManager .logger .exception ("Error suspending process" )
799
+ else :
800
+ LogManager .logger .warning ("Application process was None during pause. Calling termination." )
801
+ self .on_terminate_application (msg )
795
802
796
803
def on_resume (self , msg ):
797
- proc = psutil .Process (self .application_process .pid )
798
- proc .resume ()
799
- self .unpause_sim ()
804
+ if self .application_process is not None :
805
+ try :
806
+ proc = psutil .Process (self .application_process .pid )
807
+ proc .resume ()
808
+ self .unpause_sim ()
809
+ except Exception as e :
810
+ LogManager .logger .exception ("Error suspending process" )
811
+ else :
812
+ LogManager .logger .warning ("Application process was None during resume. Calling termination." )
813
+ self .on_terminate_application (msg )
800
814
801
815
def pause_sim (self ):
802
816
if self .visualization_type in ["gzsim_rae" , "bt_studio_gz" ]:
You can’t perform that action at this time.
0 commit comments