Skip to content

Commit 4e0a58c

Browse files
committed
minor bugs in random agg pool
1 parent 02fe9fa commit 4e0a58c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

memsql/common/random_aggregator_pool.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from memsql.common import connection_pool
1+
from memsql.common.connection_pool import ConnectionPool, PoolConnectionException
22
from wraptor.decorators import memoize
33
import threading
44
import random
@@ -13,9 +13,9 @@ class RandomAggregatorPool:
1313
aggregators by periodically calling `SHOW AGGREGATORS`.
1414
"""
1515

16-
def __init__(self, db):
16+
def __init__(self):
1717
self.logger = logging.getLogger('memsql.random_aggregator_pool')
18-
self._pool = connection_pool.Pool()
18+
self._pool = ConnectionPool()
1919
self._aggregators = []
2020
self._aggregator = None
2121
self._refresh_aggregator_list = memoize(30)(self._update_aggregator_list)
@@ -30,7 +30,7 @@ def _connect(self, host, port, user, password, database):
3030
if self._aggregator:
3131
try:
3232
return self._pool.connect(self._aggregator[0], self._aggregator[1], user, password, database)
33-
except connection_pool.PoolConnectionException:
33+
except PoolConnectionException:
3434
self._aggregator = None
3535
pass
3636

@@ -52,7 +52,7 @@ def _connect(self, host, port, user, password, database):
5252

5353
try:
5454
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:
5656
last_exception = e
5757
else:
5858
with self._lock:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!env python
1+
#!/usr/bin/env python
22

33
from distribute_setup import use_setuptools
44
use_setuptools()

0 commit comments

Comments
 (0)