mirror of https://github.com/scrapy/scrapy.git
added setting to support disabling DNS cache: DNSCACHE_ENABLED
This commit is contained in:
parent
bb67cfd955
commit
9f60c27612
|
|
@ -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 = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue