Skip to content

Commit

Permalink
fail when crawler fails
Browse files Browse the repository at this point in the history
  • Loading branch information
joergreichert committed Oct 11, 2023
1 parent 8bf0a23 commit cc12988
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 1_read_paper_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import argparse
import datetime
import scrapy
Expand Down Expand Up @@ -88,3 +89,7 @@
process = CrawlerProcess(settings)
process.crawl(OparlSpider, **spargs)
process.start()

failed = process.stats.get_value('custom/failed_job')
if failed:
sys.exit(1)

0 comments on commit cc12988

Please sign in to comment.