You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifself.is_closingandself._socket_timeouts>threshold:
ifnotself.is_closing:
LOGGER.critical('Closing connection due to timeout')
self._on_connection_closed(None, True)
if if self.is_closing and self._socket_timeouts > threshold is true, then the inner if not self.is_closing can never be true. Did the author intend the outer check to be if self.is_closing or self._socket_timeouts > threshold instead (or vs. and)?
Here is the entire method for context:
def_handle_timeout(self):
"""Invoked whenever the socket times out"""self._socket_timeouts+=1threshold= (self.SOCKET_TIMEOUT_THRESHOLDifnotself.is_closingelseself.SOCKET_TIMEOUT_CLOSE_THRESHOLD)
LOGGER.debug('Handling timeout %i with a threshold of %i',
self._socket_timeouts, threshold)
ifself.is_closingandself._socket_timeouts>threshold:
ifnotself.is_closing:
LOGGER.critical('Closing connection due to timeout')
self._on_connection_closed(None, True)
The text was updated successfully, but these errors were encountered:
This block of code doesn't make sense:
if
if self.is_closing and self._socket_timeouts > threshold
is true, then the innerif not self.is_closing
can never be true. Did the author intend the outer check to beif self.is_closing or self._socket_timeouts > threshold
instead (or vs. and)?Here is the entire method for context:
The text was updated successfully, but these errors were encountered: