1
- from memsql .common import connection_pool
1
+ from memsql .common . connection_pool import ConnectionPool , PoolConnectionException
2
2
from wraptor .decorators import memoize
3
3
import threading
4
4
import random
@@ -13,9 +13,9 @@ class RandomAggregatorPool:
13
13
aggregators by periodically calling `SHOW AGGREGATORS`.
14
14
"""
15
15
16
- def __init__ (self , db ):
16
+ def __init__ (self ):
17
17
self .logger = logging .getLogger ('memsql.random_aggregator_pool' )
18
- self ._pool = connection_pool . Pool ()
18
+ self ._pool = ConnectionPool ()
19
19
self ._aggregators = []
20
20
self ._aggregator = None
21
21
self ._refresh_aggregator_list = memoize (30 )(self ._update_aggregator_list )
@@ -30,7 +30,7 @@ def _connect(self, host, port, user, password, database):
30
30
if self ._aggregator :
31
31
try :
32
32
return self ._pool .connect (self ._aggregator [0 ], self ._aggregator [1 ], user , password , database )
33
- except connection_pool . PoolConnectionException :
33
+ except PoolConnectionException :
34
34
self ._aggregator = None
35
35
pass
36
36
@@ -52,7 +52,7 @@ def _connect(self, host, port, user, password, database):
52
52
53
53
try :
54
54
return self ._pool .connect (self ._aggregator [0 ], self ._aggregator [1 ], user , password , database )
55
- except connection_pool . PoolConnectionException as e :
55
+ except PoolConnectionException as e :
56
56
last_exception = e
57
57
else :
58
58
with self ._lock :
0 commit comments