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() 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, )