提交 9f60c276 编写于 作者: P Pablo Hoffman

added setting to support disabling DNS cache: DNSCACHE_ENABLED

上级 bb67cfd9
......@@ -366,6 +366,15 @@ Default: ``False``
Whether to collect verbose depth stats. If this is enabled, the number of
requests for each depth is collected in the stats.
.. setting:: DNSCACHE_ENABLED
DNSCACHE_ENABLED
----------------
Default: ``True``
Whether to enable DNS in-memory cache.
.. setting:: DOWNLOADER_DEBUG
DOWNLOADER_DEBUG
......
......@@ -70,7 +70,8 @@ class CrawlerProcess(Crawler):
def start(self):
super(CrawlerProcess, self).start()
reactor.installResolver(CachingThreadedResolver(reactor))
if self.settings.getbool('DNSCACHE_ENABLED'):
reactor.installResolver(CachingThreadedResolver(reactor))
reactor.addSystemEventTrigger('before', 'shutdown', self.stop)
reactor.run(installSignalHandlers=False) # blocking call
......
......@@ -49,6 +49,8 @@ DEPTH_LIMIT = 0
DEPTH_STATS = True
DEPTH_PRIORITY = 1
DNSCACHE_ENABLED = True
DOWNLOAD_DELAY = 0
DOWNLOAD_HANDLERS = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册