mirror of https://github.com/scrapy/scrapy.git
avoid stopping reactor if it's already in shutdown stage (where reactor.running is still True)
This commit is contained in:
parent
0643010f0c
commit
be76490002
|
|
@ -65,8 +65,10 @@ class ExecutionEngine(object):
|
|||
self.close_domain, domain, reason='shutdown')
|
||||
if self._mainloop_task.running:
|
||||
self._mainloop_task.stop()
|
||||
if reactor.running:
|
||||
try:
|
||||
reactor.stop()
|
||||
except RuntimeError: # raised if already stopped or in shutdown stage
|
||||
pass
|
||||
|
||||
def kill(self):
|
||||
"""Forces shutdown without waiting for pending transfers to finish.
|
||||
|
|
|
|||
Loading…
Reference in New Issue