MCPcopy Index your code
hub / github.com/bugy/script-server / finished

Method finished

src/web/server.py:289–309  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

wrap_to_server_eventFunction · 0.90
prepare_download_urlMethod · 0.80
safe_writeMethod · 0.45
stopMethod · 0.45
wait_closeMethod · 0.45

Tested by

no test coverage detected