mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-26 23:44:01 +00:00
RetryMiddleware: added ConnectionLost to retried exceptions
twisted >8.0 has a ConnectionClosed exception parent of ConnectionLost and ConnectionDone, but twisted 2.5 hasn't. I add ConnectionLost until we can move forward to twisted >8.0 this is the docstring of ConnectionLost, hopes it is self explanatory: """Connection to the other side was lost in a non-clean fashion""" --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40757
This commit is contained in:
parent
bef1fa967a
commit
8ff4dc4d02
@ -25,7 +25,8 @@ About HTTP errors to consider:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from twisted.internet.error import TimeoutError as ServerTimeoutError, DNSLookupError, \
|
from twisted.internet.error import TimeoutError as ServerTimeoutError, DNSLookupError, \
|
||||||
ConnectionRefusedError, ConnectionDone, ConnectError
|
ConnectionRefusedError, ConnectionDone, ConnectError, \
|
||||||
|
ConnectionLost
|
||||||
from twisted.internet.defer import TimeoutError as UserTimeoutError
|
from twisted.internet.defer import TimeoutError as UserTimeoutError
|
||||||
|
|
||||||
from scrapy import log
|
from scrapy import log
|
||||||
@ -36,7 +37,8 @@ from scrapy.conf import settings
|
|||||||
class RetryMiddleware(object):
|
class RetryMiddleware(object):
|
||||||
|
|
||||||
EXCEPTIONS_TO_RETRY = (ServerTimeoutError, UserTimeoutError, DNSLookupError,
|
EXCEPTIONS_TO_RETRY = (ServerTimeoutError, UserTimeoutError, DNSLookupError,
|
||||||
ConnectionRefusedError, ConnectionDone, ConnectError)
|
ConnectionRefusedError, ConnectionDone, ConnectError,
|
||||||
|
ConnectionLost)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.failed_count = {}
|
self.failed_count = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user