mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-29 04:08:12 +08:00
Allow SQS to use environment variables
This commit is contained in:
@@ -51,9 +51,12 @@ class Sqs(Broker):
|
||||
|
||||
@staticmethod
|
||||
def get_connection(list_key=Conf.PREFIX):
|
||||
return Session(aws_access_key_id=Conf.SQS['aws_access_key_id'],
|
||||
aws_secret_access_key=Conf.SQS['aws_secret_access_key'],
|
||||
region_name=Conf.SQS['aws_region'])
|
||||
config = Conf.SQS
|
||||
if 'aws_region' in config:
|
||||
config['region_name'] = config['aws_region']
|
||||
del(config['aws_region'])
|
||||
return Session(**config)
|
||||
|
||||
|
||||
def get_queue(self):
|
||||
self.sqs = self.connection.resource('sqs')
|
||||
|
||||
Reference in New Issue
Block a user