refactor: Rename get_client to create_client for consistency
This commit is contained in:
parent
a5cef08fd2
commit
906ecb7816
@ -85,9 +85,10 @@ def initialize_pool():
|
|||||||
logger.error(f"Error initializing pool connection: {str(e)}")
|
logger.error(f"Error initializing pool connection: {str(e)}")
|
||||||
break
|
break
|
||||||
|
|
||||||
def get_client():
|
def create_client():
|
||||||
"""
|
"""
|
||||||
Get a client from the pool or create a new one if needed
|
Get a client from the pool or create a new one if needed.
|
||||||
|
Maintains the original function name for compatibility.
|
||||||
"""
|
"""
|
||||||
# Initialize pool if empty
|
# Initialize pool if empty
|
||||||
with pool_lock:
|
with pool_lock:
|
||||||
@ -124,3 +125,6 @@ def return_client(client):
|
|||||||
client.close()
|
client.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Error returning client to pool: {str(e)}")
|
logger.warning(f"Error returning client to pool: {str(e)}")
|
||||||
|
|
||||||
|
# Export the create_client function
|
||||||
|
__all__ = ['create_client']
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user