mirror of https://github.com/scrapy/scrapy.git
downloader: added site.closed additional check to domain already closed
This commit is contained in:
parent
5944f6590a
commit
abe4f812e9
|
|
@ -135,10 +135,10 @@ class Downloader(object):
|
|||
|
||||
def close_domain(self, domain):
|
||||
"""Free any resources associated with the given domain"""
|
||||
if domain not in self.sites:
|
||||
site = self.sites.get(domain)
|
||||
if not site or site.closed:
|
||||
raise RuntimeError('Downloader domain already closed: %s' % domain)
|
||||
|
||||
site = self.sites[domain]
|
||||
site.closed = True
|
||||
spider = spiders.fromdomain(domain)
|
||||
self.process_queue(spider)
|
||||
|
|
|
|||
Loading…
Reference in New Issue