MCPcopy
hub / github.com/scrapy/scrapy / get_slot_key

Method get_slot_key

scrapy/core/downloader/__init__.py:166–175  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

164 return key, self.slots[key]
165
166 def get_slot_key(self, request: Request) -> str:
167 meta_slot: str | None = request.meta.get(self.DOWNLOAD_SLOT)
168 if meta_slot is not None:
169 return meta_slot
170
171 key = urlparse_cached(request).hostname or ""
172 if self.ip_concurrency:
173 key = dnscache.get(key, key)
174
175 return key
176
177 # passed as download_func into self.middleware.download() in self.fetch()
178 async def _enqueue_request(self, request: Request) -> Response:

Callers 1

_get_slotMethod · 0.95

Calls 2

urlparse_cachedFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected