Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed May 17, 2023
2 parents 3107c79 + d74d9af commit 49c43e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ jobs:
run: |
pip install -U pip poetry
poetry config virtualenvs.create false
pip3 install wheel setuptools pip --upgrade
- name: Run ci
run: make ci
10 changes: 5 additions & 5 deletions asyncmy/pool.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Pool(asyncio.AbstractServer):
raise ValueError("maxsize should be not less than minsize")
self._minsize = minsize
self._loop = asyncio.get_event_loop()
self._conn_kwargs = {**kwargs, echo: echo}
self._conn_kwargs = {**kwargs, "echo": echo}
self._acquiring = 0
self._free: Deque[Connection] = collections.deque(maxlen=maxsize)
self._cond = asyncio.Condition()
Expand Down Expand Up @@ -199,18 +199,18 @@ class Pool(asyncio.AbstractServer):


def create_pool(
minsize: int = 1, maxsize: int = 10, echo=False, pool_recycle: int = 3600, **kwargs
minsize: int = 1, maxsize: int = 10, echo = False, pool_recycle: int = 3600, **kwargs
):
coro = _create_pool(
minsize=minsize, maxsize=maxsize, echo=echo, pool_recycle=pool_recycle, **kwargs
minsize = minsize, maxsize = maxsize, echo = echo, pool_recycle = pool_recycle, **kwargs
)
return _PoolContextManager(coro)

async def _create_pool(
minsize: int = 1, maxsize: int = 10, echo=False, pool_recycle: int = 3600, **kwargs
minsize: int = 1, maxsize: int = 10, echo = False, pool_recycle: int = 3600, **kwargs
):
pool = Pool(
minsize=minsize, maxsize=maxsize, echo=echo, pool_recycle=pool_recycle, **kwargs
minsize = minsize, maxsize = maxsize, echo = echo, pool_recycle = pool_recycle, **kwargs
)
if minsize > 0:
async with pool.cond:
Expand Down

0 comments on commit 49c43e2

Please sign in to comment.