From b887346fe87f3be1cc94b7829b00e29f7820be0c Mon Sep 17 00:00:00 2001 From: Vu Chau Date: Fri, 15 Jun 2018 00:21:38 +0700 Subject: [PATCH 1/2] fixed get datetime now --- scrapy_httpcache/extensions/httpcache_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapy_httpcache/extensions/httpcache_storage.py b/scrapy_httpcache/extensions/httpcache_storage.py index ec3dfa6..0b804ef 100644 --- a/scrapy_httpcache/extensions/httpcache_storage.py +++ b/scrapy_httpcache/extensions/httpcache_storage.py @@ -88,7 +88,7 @@ def _read_data(self, spider, request): returnValue() else: return - if 0 < self.expiration_secs < (datetime.datetime.now - data['update_time']).seconds: + if 0 < self.expiration_secs < (datetime.datetime.now() - data['update_time']).seconds: yield self._coll.delete_one({'fingerprint': key}) if six.PY2: returnValue() From 8e84b496cbc15db7c1f0e2cfe474242094930f30 Mon Sep 17 00:00:00 2001 From: Vu Chau Date: Fri, 15 Jun 2018 00:21:55 +0700 Subject: [PATCH 2/2] added missing requirement --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ed70fba..9059a38 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,8 @@ 'Topic :: Software Development :: Libraries :: Python Modules', ], install_requires=[ - 'scrapy>=1.4.0' + 'scrapy>=1.4.0', + 'txmongo==18.1.0' ], extras_require=extras_require, )