|
@@ -26,6 +26,7 @@ class SQLHandlerPool(metaclass=SingletonThreadsafe):
|
|
|
def __init__(self, size: int = 20):
|
|
|
self._size = size
|
|
|
self._log = Log(name='SQLHandlerPool')
|
|
|
+ self._log('############################# CREATED NEW POOL ###################################')
|
|
|
self._sql_handlers = [SQLHandler() for _ in range(size)]
|
|
|
|
|
|
def aquire(self):
|
|
@@ -39,7 +40,7 @@ class SQLHandlerPool(metaclass=SingletonThreadsafe):
|
|
|
if len(self._sql_handlers) < self._size:
|
|
|
self._sql_handlers.append(sql_handler)
|
|
|
|
|
|
-class SQLHandler:
|
|
|
+class SQLHandler(metaclass=SingletonThreadsafe):
|
|
|
'''
|
|
|
Resembles methods for executing sql queries
|
|
|
with different dabase connectors.
|