1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-21 05:13:16 +00:00

engine.stop() is now always executed when reactor stops

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4045
This commit is contained in:
Pablo Hoffman 2008-07-07 17:37:55 +00:00
parent 6bdbcd8173
commit 648b312bca

View File

@ -121,6 +121,7 @@ class ExecutionEngine(object):
reactor.listenTCP(*args, **kwargs)
self.running = True
reactor.run() # blocking call
self.stop()
def stop(self):
"""Stop the execution engine"""
@ -134,7 +135,8 @@ class ExecutionEngine(object):
self.tasks = []
for p in [p for p in self.ports if not isinstance(p, tuple)]:
p.stopListening()
reactor.stop()
if reactor.running:
reactor.stop()
signals.send_catch_log(signal=signals.engine_stopped, sender=self.__class__)
def pause(self):