(sig, frame, display_thread, ragnar_thread, web_thread=None)
| 212 | |
| 213 | |
| 214 | def handle_exit(sig, frame, display_thread, ragnar_thread, web_thread=None): |
| 215 | from init_shared import shared_data |
| 216 | shared_data.should_exit = True |
| 217 | shared_data.orchestrator_should_exit = True |
| 218 | shared_data.display_should_exit = True |
| 219 | shared_data.webapp_should_exit = True |
| 220 | |
| 221 | from pager_display import handle_exit_pager_display |
| 222 | display_inst = getattr(shared_data, 'display_instance', None) |
| 223 | handle_exit_pager_display(sig, frame, display_inst, exit_process=False) |
| 224 | |
| 225 | if display_thread and display_thread.is_alive(): |
| 226 | display_thread.join(timeout=5) |
| 227 | if ragnar_thread and ragnar_thread.is_alive(): |
| 228 | ragnar_thread.join(timeout=5) |
| 229 | if web_thread and web_thread.is_alive(): |
| 230 | web_thread.join(timeout=5) |
| 231 | logger.info("Clean exit.") |
| 232 | sys.exit(0) |
| 233 | |
| 234 | |
| 235 | if __name__ == "__main__": |
no test coverage detected