Skip to content

Commit

Permalink
Merge pull request #1 from lmctv/master
Browse files Browse the repository at this point in the history
Indeed typos, something went wrong on the merge back towards the repo
Thanks for this
  • Loading branch information
jve committed Aug 24, 2012
2 parents 77e5765 + e96a647 commit 9095c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pika/adapters/blocking_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ def _adapter_connect(self):
BaseConnection._adapter_connect(self)
self.socket.setblocking(1)
# Set the timeout for reading/writing on the socket
self.socket.settimeout(paramaters.socket_timeout or SOCKET_TIMEOUT)
self.socket.settimeout(self.parameters.socket_timeout or SOCKET_TIMEOUT)
self._socket_timeouts = 0
self._on_connected()
self._timeouts = dict()

# When using a high availability cluster (such as HAProxy) we are always able to connect
# even though there might be no RabbitMQ backend.
# even though there might be no RabbitMQ backend.
socket_timeout_retries = 0
while not self.is_open and socket_timeout_retries<SOCKET_TIMEOUT_THRESHOLD:
self._flush_outbound()
self._handle_read()
timeout_retries +=1
socket_timeout_retries +=1

if not self.is_open:
raise AMQPConnectionError("No connection could be opened after %s retries" % SOCKET_TIMEOUT_THRESHOLD)
Expand Down
4 changes: 2 additions & 2 deletions pika/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def __init__(self,
raise TypeError("retry_delay must be an int")

# Validate the socket timeout delay
if not isinstance(socket_timeout, int):
raise TypeError("socket_timeout must be an int")
if not (isinstance(socket_timeout, int) or isinstance(socket_timeout, types.NoneType)):
raise TypeError("socket_timeout must be either None or int")

# Assign our values
self.host = host
Expand Down

0 comments on commit 9095c9c

Please sign in to comment.