Skip to content

Commit

Permalink
fix pipeline log
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed May 18, 2022
1 parent a830eb0 commit ce20919
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hepcrawl/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def process_item(self, item, spider):
if 'dois' in item:
value = [doi['value'] for doi in item['dois']]
if len(value) > 0:
self.logger.info('Processing article.', name=spider.name, doi=value[0])
self.logger.info('Processing article.', name=spider.name, doi=str(value[0]))
self.dois.append(value)
else:
self.logger.error('Empty DOIs for this article.', name=spider.name)
Expand Down Expand Up @@ -273,5 +273,7 @@ def close_spider(self, spider):
task_endpoint,
kwargs=self._prepare_payload(spider),
)

self.logger.info('Spider successfully send payload.', name=spider.name, dois=self.dois, count=self.count)
else:
self.logger.error('Spider cannot send payload.', name=spider.name, dois=self.dois, count=self.count)
self._cleanup(spider)

0 comments on commit ce20919

Please sign in to comment.