From b306927e721349302d9a30511e8eb0c0676d4e04 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 29 Apr 2020 14:44:49 -0700 Subject: timeouts: don't push through None error messages --- python/sandcrawler/workers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/sandcrawler/workers.py') diff --git a/python/sandcrawler/workers.py b/python/sandcrawler/workers.py index 9f1b55c..96aef3f 100644 --- a/python/sandcrawler/workers.py +++ b/python/sandcrawler/workers.py @@ -69,10 +69,10 @@ class SandcrawlerWorker(object): self.counts['timeout'] += 1 resp = self.timeout_response(task) # pylint: disable=assignment-from-none # TODO: what if it is this push_record() itself that is timing out? - if self.sink: + if resp and self.sink: self.sink.push_record(resp) self.counts['pushed'] += 1 - else: + elif resp: print(json.dumps(resp)) finally: signal.alarm(0) -- cgit v1.2.3