Merge branch 'main' into dk/error-handling-hotfix

This commit is contained in:
David Kennedy 2023-11-15 06:10:11 -05:00
commit 5042f1a297
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 5 additions and 5 deletions

View file

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

View file

@ -97,7 +97,7 @@ class EPPConnectionPool(ConnectionPool):
def kill_all_connections(self): def kill_all_connections(self):
"""Kills all active connections in the pool.""" """Kills all active connections in the pool."""
try: try:
if len(self.conn) > 0: if len(self.conn) > 0 or len(self.greenlets) > 0:
gevent.killall(self.greenlets) gevent.killall(self.greenlets)
self.greenlets.clear() self.greenlets.clear()
@ -116,7 +116,7 @@ class EPPConnectionPool(ConnectionPool):
If any connections exist, kill them first. If any connections exist, kill them first.
Based off of the __init__ definition for geventconnpool. Based off of the __init__ definition for geventconnpool.
""" """
if len(self.conn) > 0: if len(self.conn) > 0 or len(self.greenlets) > 0:
self.kill_all_connections() self.kill_all_connections()
# Setup the lock # Setup the lock

View file

@ -365,14 +365,14 @@ class Command(BaseCommand):
contact.save() contact.save()
else: else:
logger.warning(f"Duplicate contact found {contact}. Updating all relevant entries.") logger.warning(f"Duplicate contact found {contact}. Updating all relevant entries.")
for c in contact: for c in contacts:
c.first_name = first_name c.first_name = first_name
c.middle_name = middle_name c.middle_name = middle_name
c.last_name = last_name c.last_name = last_name
c.email = email c.email = email
c.phone = phone c.phone = phone
c.save() c.save()
contact = c.first() contact = contacts.first()
return contact return contact
def create_new_domain_info( def create_new_domain_info(