MCPcopy
hub / github.com/scrapy/scrapy / _get_slot

Method _get_slot

scrapy/extensions/throttle.py:95–102  ·  view source on GitHub ↗
(
        self, request: Request, spider: Spider
    )

Source from the content-addressed store, hash-verified

93 )
94
95 def _get_slot(
96 self, request: Request, spider: Spider
97 ) -> tuple[str | None, Slot | None]:
98 key: str | None = request.meta.get("download_slot")
99 if key is None:
100 return None, None
101 assert self.crawler.engine
102 return key, self.crawler.engine.downloader.slots.get(key)
103
104 def _adjust_delay(self, slot: Slot, latency: float, response: Response) -> None:
105 """Define delay adjustment policy"""

Callers 1

_response_downloadedMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected