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

Method get_slot_key

tests/test_scheduler.py:69–73  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

67 self.slots: dict[str, MockSlot] = {}
68
69 def get_slot_key(self, request: Request) -> str:
70 if Downloader.DOWNLOAD_SLOT in request.meta:
71 return cast("str", request.meta[Downloader.DOWNLOAD_SLOT])
72
73 return urlparse_cached(request).hostname or ""
74
75 def increment(self, slot_key: str) -> None:
76 slot = self.slots.setdefault(slot_key, MockSlot(active=[]))

Callers 1

_assertMethod · 0.45

Calls 1

urlparse_cachedFunction · 0.90

Tested by

no test coverage detected