提交 f0ded6b7 编写于 作者: P Paul Tremberth

Do not cache DNS responses when cache size is 0

上级 1f08d9a6
......@@ -22,7 +22,8 @@ class CachingThreadedResolver(ThreadedResolver):
# to enforce Scrapy's DNS_TIMEOUT setting's value
timeout = (self.timeout,)
d = super(CachingThreadedResolver, self).getHostByName(name, timeout)
d.addCallback(self._cache_result, name)
if dnscache.limit:
d.addCallback(self._cache_result, name)
return d
def _cache_result(self, result, name):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册