Skip to content

Commit

Permalink
Fix aio_server bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tim.reichard committed Nov 11, 2020
1 parent 9fb1a76 commit ff9dcae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ History
=======


v0.8.5 (2020-11-11)
-----------------------

* Fix bug with accessing active keyword incorrectly in aws/utils.py aio_server function.


v0.8.4 (2020-10-27)
-----------------------

Expand Down
5 changes: 2 additions & 3 deletions aioradio/aws/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ async def aio_server(self, item, region=None):
'''Begin long running server establishing modules service_dict object.'''

service_dict = self.service_dict if region is None else self.service_dict[region]
service_dict = service_dict[item]
await self.establish_client_resource(service_dict, item, region=region)
await self.establish_client_resource(service_dict[item], item, region=region)

while True:
# sleep for defined interval
Expand All @@ -89,7 +88,7 @@ async def aio_server(self, item, region=None):
while service_dict['active'] and (time() - start) < 300:
await sleep(0.001)

await self.establish_client_resource(service_dict, item=item, region=region, reestablish=True)
await self.establish_client_resource(service_dict[item], item=item, region=region, reestablish=True)

async def establish_client_resource(self, service_dict, item, region=None, reestablish=False):
'''Establish the AioSession client or resource, then re-establish every self.sleep_interval seconds.'''
Expand Down
8 changes: 4 additions & 4 deletions aioradio/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ aioboto3==8.0.5
aiobotocore==1.1.2
aiojobs==0.2.2
aioredis==1.3.1
ddtrace==0.43.0
ddtrace==0.43.1
fakeredis==1.4.4
flask==1.1.2
httpx==0.16.1
mandrill==1.0.59
moto==1.3.16
orjson==3.4.1
pre-commit==2.7.1
orjson==3.4.3
pre-commit==2.8.2
pylint==2.6.0
pyodbc==4.0.30
pysmb==1.2.5
pytest==6.1.1
pytest==6.1.2
pytest-asyncio==0.14.0
pytest-cov==2.10.1
python-json-logger==2.0.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.8.4',
version='0.8.5',
description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit ff9dcae

Please sign in to comment.