Skip to content

Commit

Permalink
Merge pull request #115 from nrccua/DS-457-add-sqs-region-assigning-i…
Browse files Browse the repository at this point in the history
…n-longrunningjobs

Hard-code 'us-east-1' and 'us-east-2' as regions in SQS AwsServiceMan…
  • Loading branch information
nrccua-timr authored Nov 16, 2023
2 parents d0c19f9 + 491d25a commit b09051d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 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.20.2 (2023-11-16)

* Hard-code 'us-east-1' and 'us-east-2' as regions in SQS AwsServiceManager.


v0.20.1 (2023-11-16)

* Add sqs.sync_add_regions for setting region besides us-east-1 during instantiation of LongRunningJobs.
Expand Down
12 changes: 1 addition & 11 deletions aioradio/aws/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aioradio.aws.utils import AwsServiceManager

LOG = logging.getLogger(__name__)
AWS_SERVICE = AwsServiceManager(service='sqs', regions=['us-east-1'])
AWS_SERVICE = AwsServiceManager(service='sqs', regions=['us-east-1', 'us-east-2'])
SQS = AWS_SERVICE.service_dict


Expand All @@ -25,16 +25,6 @@ async def add_regions(regions: List[str]):
AWS_SERVICE.add_regions(regions)


def sync_add_regions(regions: List[str]):
"""Add regions to SQS AWS service.
Args:
regions (List[str]): List of AWS regions
"""

AWS_SERVICE.add_regions(regions)


@AWS_SERVICE.active
async def create_queue(queue: str, region: str, attributes: Dict[str, str], account_id: str='') -> Dict[str, Any]:
"""Create SQS queue in region defined.
Expand Down
1 change: 0 additions & 1 deletion aioradio/long_running_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class LongRunningJobs:
# define the queue name and aws region
sqs_queue: str = None
sqs_region: str = None
sqs.sync_add_regions([sqs_region])

# If running test cases use fakeredis
fakeredis: bool = False
Expand Down
2 changes: 1 addition & 1 deletion 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.20.1',
version='0.20.2',
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 b09051d

Please sign in to comment.