mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Merge branch 'main' into dk/error-handling-hotfix
This commit is contained in:
commit
5042f1a297
3 changed files with 5 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue