コード例 #1
0
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         server_utils.delete_server(self.server_task_name)
コード例 #2
0
ファイル: messenger_manager.py プロジェクト: ahiroto/ParlAI
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         server_utils.delete_server(self.server_task_name)
コード例 #3
0
ファイル: messenger_manager.py プロジェクト: xlrshop/Parl
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         if not self.bypass_server_setup:
             self.message_socket.keep_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         if not self.bypass_server_setup:
             server_utils.delete_server(self.server_task_name,
                                        self.opt['local'])
コード例 #4
0
    def shutdown(self):
        """Handle any client shutdown cleanup."""
        # Ensure all threads are cleaned and conversations are handled
        try:
            self.is_running = False
            self.world_runner.shutdown()
            if not self.bypass_server_setup:
                self.message_socket.keep_running = False
            self._expire_all_conversations()
        except BaseException as e:
            shared_utils.print_and_log(logging.ERROR,
                                       f'world ended in error: {e}')

        finally:
            if not self.bypass_server_setup:
                server_utils.delete_server(self.server_task_name,
                                           self.opt['local'])