diff --git a/HISTORY.rst b/HISTORY.rst index 180ed56..5db1a39 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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. diff --git a/aioradio/long_running_jobs.py b/aioradio/long_running_jobs.py index 2f3a1cf..5f3ba6e 100644 --- a/aioradio/long_running_jobs.py +++ b/aioradio/long_running_jobs.py @@ -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: @@ -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. diff --git a/aioradio/requirements.txt b/aioradio/requirements.txt index 305a463..40b1253 100644 --- a/aioradio/requirements.txt +++ b/aioradio/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 15c0135..56e522e 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -23,14 +23,14 @@ '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' ], @@ -38,9 +38,9 @@ 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'