()
| 287 | web_socket = self |
| 288 | |
| 289 | def finished(): |
| 290 | try: |
| 291 | downloadable_files = file_download_feature.get_downloadable_files(execution_id) |
| 292 | |
| 293 | for file in downloadable_files: |
| 294 | filename = os.path.basename(file) |
| 295 | url_path = web_socket.prepare_download_url(file) |
| 296 | |
| 297 | web_socket.safe_write(wrap_to_server_event( |
| 298 | 'file', |
| 299 | {'url': url_path, 'filename': filename})) |
| 300 | except: |
| 301 | LOGGER.exception('Could not prepare downloadable files') |
| 302 | |
| 303 | connection = web_socket.ws_connection |
| 304 | if (connection is not None) and (hasattr(connection, 'ping_callback')): |
| 305 | # we need to stop callback explicitly and as soon as possible, to avoid sending ping after close |
| 306 | connection.ping_callback.stop() |
| 307 | |
| 308 | output_stream.wait_close(timeout=5) |
| 309 | web_socket.ioloop.add_callback(web_socket.close, code=1000) |
| 310 | |
| 311 | file_download_feature.subscribe_on_inline_images(execution_id, self.send_inline_image) |
| 312 |
nothing calls this directly
no test coverage detected