コード例 #1
0
 def shutdown(self):
     """Handle any mturk client shutdown cleanup."""
     # Ensure all threads are cleaned and state and HITs are handled
     self.expire_all_unassigned_hits()
     self._expire_onboarding_pool()
     self._expire_worker_pool()
     for assignment_id in self.assignment_to_onboard_thread:
         self.assignment_to_onboard_thread[assignment_id].join()
     self._save_disconnects()
     delete_server(self.server_task_name)
コード例 #2
0
ファイル: mturk_manager.py プロジェクト: jojonki/ParlAI
 def shutdown(self):
     """Handle any mturk client shutdown cleanup."""
     # Ensure all threads are cleaned and state and HITs are handled
     self.expire_all_unassigned_hits()
     self._expire_onboarding_pool()
     self._expire_worker_pool()
     self.socket_manager.close_all_channels()
     for assignment_id in self.assignment_to_onboard_thread:
         self.assignment_to_onboard_thread[assignment_id].join()
     self._save_disconnects()
     server_utils.delete_server(self.server_task_name)
コード例 #3
0
ファイル: mturk_manager.py プロジェクト: jithsjoy/ParlAI
 def shutdown(self):
     """Handle any mturk client shutdown cleanup."""
     # Ensure all threads are cleaned and state and HITs are handled
     try:
         self.expire_all_unassigned_hits()
         self._expire_onboarding_pool()
         self._expire_worker_pool()
         self.socket_manager.close_all_channels()
         for assignment_id in self.assignment_to_onboard_thread:
             self.assignment_to_onboard_thread[assignment_id].join()
     except:
         pass
     finally:
         server_utils.delete_server(self.server_task_name)
         mturk_utils.delete_sns_topic(self.topic_arn)
         self._save_disconnects()