mirror of https://github.com/scrapy/scrapy.git
Reliability improvements
This commit is contained in:
parent
7668a693e8
commit
49b839b270
|
|
@ -198,6 +198,8 @@ class ExecutionEngine:
|
|||
exc_info=True,
|
||||
)
|
||||
else:
|
||||
if not self.spider:
|
||||
return # spider already closed
|
||||
if isinstance(item_or_request, Request):
|
||||
self.crawl(item_or_request)
|
||||
else:
|
||||
|
|
@ -219,7 +221,7 @@ class ExecutionEngine:
|
|||
self._slot.nextcall.schedule()
|
||||
self._slot.heartbeat.start(self._SLOT_HEARTBEAT_INTERVAL)
|
||||
|
||||
while self._start is not None:
|
||||
while self._start and self.spider:
|
||||
await self._process_start_next()
|
||||
if not self.needs_backout():
|
||||
# Give room for the outcome of self._process_start_next() to be
|
||||
|
|
|
|||
|
|
@ -109,9 +109,6 @@ class RequestSendOrderTestCase(TestCase):
|
|||
that can be sent before the first callback requests are scheduled.
|
||||
"""
|
||||
|
||||
# Error out if any tests relies on the heartbeat.
|
||||
timeout = ExecutionEngine._SLOT_HEARTBEAT_INTERVAL
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.mockserver = MockServer()
|
||||
|
|
@ -122,7 +119,7 @@ class RequestSendOrderTestCase(TestCase):
|
|||
cls.mockserver.__exit__(None, None, None)
|
||||
|
||||
fast_seconds = 0.001
|
||||
slow_seconds = 1 # increase if flaky
|
||||
slow_seconds = 2 # increase if flaky
|
||||
|
||||
def _request(self, num, response_seconds, download_slots):
|
||||
url = self.mockserver.url(f"/delay?n={response_seconds}&{num}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue