Skip to content

Commit

Permalink
fix(http): default callback condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
zireael committed Oct 29, 2019
1 parent 66222c1 commit 0d40b67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acrawler/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ async def _produce_tasks_from_start_requests(self):
logger.debug("Produce initial tasks...")
async for task in to_asyncgen(self.crawler.start_requests):
if isinstance(task, Request):
task.add_callback(self.crawler.parse)
if not task.callbacks:
task.add_callback(self.crawler.parse)
await self.crawler.add_task(task)
elif isinstance(task, Task):
await self.crawler.add_task(task)
Expand Down

0 comments on commit 0d40b67

Please sign in to comment.