From 06dbe5e389add5c424b09c21c93fdd7d575fc57b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 12 Aug 2019 17:17:53 +0200 Subject: Add duration for timeout --- commcrawler/scrapy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/commcrawler/scrapy.py b/commcrawler/scrapy.py index f4be032..e20dcdc 100644 --- a/commcrawler/scrapy.py +++ b/commcrawler/scrapy.py @@ -127,6 +127,7 @@ class DefaultSpider: result = models.CrawlResult.objects.select_for_update().get( pk=self.crawl_result.pk) result.status = "T" + result.duration = (timezone.now() - result.started) result.save() raise CloseSpider('timeout') -- cgit v1.2.3