Skip to content

Commit

Permalink
Merge pull request #49 from nrccua/DS-99-add-senttimestamp-attribute-…
Browse files Browse the repository at this point in the history
…in-get_messages

Adding SentTimestamp attribute in SQS get_messages
  • Loading branch information
nrccua-timr authored Jul 30, 2021
2 parents 8636920 + 1cb1082 commit 8791da1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ History
=======


v0.14.3 (2021-07-30)

* Add SentTimestamp attribute to SQS get_messages function.


v0.14.2 (2021-07-22)

* Update aioboto3==9.2.0.
Expand Down
6 changes: 5 additions & 1 deletion aioradio/long_running_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ async def __sqs_pull_messages_and_run_jobs__(self):
region=self.sqs_region,
wait_time=1,
visibility_timeout=self.longest_job_timeout,
max_messages=1
max_messages=1,
attribute_names=['SentTimestamp']
)

if not msg:
Expand Down Expand Up @@ -229,6 +230,9 @@ async def __sqs_pull_messages_and_run_jobs__(self):
entries = [{'Id': str(uuid4()), 'ReceiptHandle': msg[0]['ReceiptHandle']}]
await sqs.delete_messages(queue=self.sqs_queue, region=self.sqs_region, entries=entries)

total = round(time() - float(msg[0]['Attributes']['SentTimestamp'])/1000, 3)
print(f"Async college match processing time for UUID {body['uuid']} took {total} seconds")

async def __redis_pull_messages_and_run_jobs__(self, job_name):
"""Pull messages one at a time and run job.
Expand Down
8 changes: 4 additions & 4 deletions aioradio/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ aioboto3==9.2.0
aiobotocore==1.3.3
aiojobs==0.3.0
boto3==1.17.106
ddtrace==0.50.1
ddtrace==0.50.3
fakeredis==1.5.2
flask==2.0.1
flask-cors==3.0.10
httpx==0.18.2
mandrill==1.0.60
moto==2.1.0
moto==2.2.0
orjson==3.5.3
pre-commit==2.13.0
psycopg2-binary==2.9.1
pylint==2.9.5
pylint==2.9.6
pyodbc==4.0.30
pysmb==1.2.7
pytest==6.2.4
pytest-asyncio==0.15.1
pytest-cov==2.12.1
python-json-logger==2.0.1
python-json-logger==2.0.2
redis==3.5.3
twine==3.4.2
wheel==0.36.2
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.14.2',
version='0.14.3',
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 All @@ -23,24 +23,24 @@
'aiobotocore==1.3.3',
'aiojobs==0.3.0',
'boto3==1.17.106',
'ddtrace==0.50.1',
'ddtrace==0.50.3',
'fakeredis==1.5.2',
'httpx==0.18.2',
'mandrill==1.0.60',
'orjson==3.6.0',
'psycopg2-binary==2.9.1',
'pysmb==1.2.7',
'python-json-logger==2.0.1',
'python-json-logger==2.0.2',
'redis==3.5.3',
'xlrd==2.0.1'
],
include_package_data=True,
tests_require=[
'flask==2.0.1',
'flask-cors==3.0.10',
'moto==2.1.0',
'moto==2.2.0',
'pre-commit==2.13.0',
'pylint==2.9.5',
'pylint==2.9.6',
'pytest==6.2.4',
'pytest-asyncio==0.15.1',
'pytest-cov==2.12.1'
Expand Down

0 comments on commit 8791da1

Please sign in to comment.