Fix attr err

This commit is contained in:
zandercymatics 2023-11-15 15:06:56 -07:00
parent ffb7276a8a
commit 4a0e8aa780
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -82,7 +82,10 @@ class Socket:
response = self.client.send(self.login)
except (LoginError, OSError) as err:
logger.error(err)
if err.should_retry() and counter < 10:
should_retry = True
if isinstance(err, LoginError):
should_retry = err.should_retry()
if should_retry and counter < 10:
counter += 1
sleep((counter * 50) / 1000) # sleep 50 ms to 150 ms
else: # don't try again