MCPcopy Create free account
hub / github.com/apify/crawlee-python / slow_response

Function slow_response

tests/unit/server.py:433–439  ·  view source on GitHub ↗

Handle requests with a configurable delay to test timeouts.

(scope: dict[str, Any], _receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

431
432
433async def slow_response(scope: dict[str, Any], _receive: Receive, send: Send) -> None:
434 """Handle requests with a configurable delay to test timeouts."""
435 query_params = get_query_params(scope.get('query_string', b''))
436 delay = float(query_params.get('delay', '5')) # Default 5 second delay
437
438 await asyncio.sleep(delay)
439 await send_html_response(send, HELLO_WORLD)
440
441
442async def infinite_scroll_endpoint(_scope: dict[str, Any], _receive: Receive, send: Send) -> None:

Callers

nothing calls this directly

Calls 2

get_query_paramsFunction · 0.85
send_html_responseFunction · 0.85

Tested by

no test coverage detected