Skip to content

Commit

Permalink
Increment url_count as they are yielded
Browse files Browse the repository at this point in the history
  • Loading branch information
ejulio committed Aug 27, 2019
1 parent f859471 commit e876626
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions spider_feeder/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ def __call__(self):
yield from self

def __iter__(self):
n_urls = 0
for item in self._store:
yield item
n_urls += 1

self._crawler.stats.set_value(f'spider_feeder/{self._spider.name}/url_count', n_urls)
self._crawler.stats.inc_value(f'spider_feeder/{self._spider.name}/url_count')

0 comments on commit e876626

Please sign in to comment.