MCPcopy Index your code
hub / github.com/plotly/dash / _after_request

Method _after_request

dash/backends/_flask.py:299–313  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

297 }
298
299 def _after_request(response: Response): # type: ignore[name-defined]
300 timing_information = flask_g.get("timing_information", None) # type: ignore[attr-defined]
301 if timing_information is None:
302 return response
303 dash_total = timing_information.get("__dash_server", None)
304 if dash_total is not None:
305 dash_total["dur"] = round((time.time() - dash_total["dur"]) * 1000)
306 for name, info in timing_information.items():
307 value = name
308 if info.get("desc") is not None:
309 value += f';desc="{info["desc"]}"'
310 if info.get("dur") is not None:
311 value += f";dur={info['dur']}"
312 response.headers.add("Server-Timing", value)
313 return response
314
315 self.before_request(_before_request)
316 self.after_request(_after_request)

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected