Skip to content

Commit 5eb3a76

Browse files
MantisusCopilot
andauthored
Update src/crawlee/request_loaders/_sitemap_request_loader.py
Okay, I agree, those are unnecessary checks. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7442320 commit 5eb3a76

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

src/crawlee/request_loaders/_sitemap_request_loader.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,12 @@ async def is_empty(self) -> bool:
308308
@override
309309
async def is_finished(self) -> bool:
310310
"""Check if all URLs have been processed."""
311-
if self._loading_task is None:
312-
raise RuntimeError('SitemapRequestLoader has not been started.')
313-
314311
state = await self._get_state()
315312
return not state.url_queue and len(state.in_progress) == 0 and self._loading_task.done()
316313

317314
@override
318315
async def fetch_next_request(self) -> Request | None:
319316
"""Fetch the next request to process."""
320-
if self._loading_task is None:
321-
raise RuntimeError('SitemapRequestLoader has not been started.')
322-
323317
while not (await self.is_finished()):
324318
state = await self._get_state()
325319
if not state.url_queue:

0 commit comments

Comments
 (0)