closedomain: check if domain was opened successfully before removing not existent task

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401098
This commit is contained in:
Daniel Grana 2009-04-27 18:49:13 +00:00
parent 940d0090af
commit cc62bba80e
1 changed files with 2 additions and 1 deletions

View File

@ -43,4 +43,5 @@ class CloseDomain(object):
self.mail.send(self.notify, subj, body)
def domain_closed(self, domain):
scrapyengine.removetask(self.tasks[domain])
if domain in self.tasks:
scrapyengine.removetask(self.tasks[domain])