downloader: added site.closed additional check to domain already closed

This commit is contained in:
Pablo Hoffman 2009-06-21 14:16:40 -03:00
parent 5944f6590a
commit abe4f812e9
1 changed files with 2 additions and 2 deletions

View File

@ -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)