This commit is contained in:
zandercymatics 2024-03-12 14:59:55 -06:00
parent ee60be8b10
commit 3b9f68ac4b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -54,7 +54,7 @@ class EPPLibWrapper:
], ],
) )
# We should only ever have one active connection at a time, # We should only ever have one active connection at a time,
# given that # given that
self.connection_lock = BoundedSemaphore(1) self.connection_lock = BoundedSemaphore(1)
try: try:
self._initialize_client() self._initialize_client()
@ -105,7 +105,7 @@ class EPPLibWrapper:
self._client.send(commands.Logout()) # type: ignore self._client.send(commands.Logout()) # type: ignore
except Exception as err: except Exception as err:
logger.warning(f"Logout command not sent successfully: {err}") logger.warning(f"Logout command not sent successfully: {err}")
def _close_client(self): def _close_client(self):
"""Closes an active client connection""" """Closes an active client connection"""
try: try:
@ -161,7 +161,7 @@ class EPPLibWrapper:
cmd_type = command.__class__.__name__ cmd_type = command.__class__.__name__
if not cleaned: if not cleaned:
raise ValueError("Please sanitize user input before sending it.") raise ValueError("Please sanitize user input before sending it.")
self.connection_lock.acquire() self.connection_lock.acquire()
try: try:
return self._send(command) return self._send(command)