mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 22:48:12 +08:00
[cleanup] Fix some linting issues
This commit is contained in:
@@ -57,7 +57,6 @@ class Sqs(Broker):
|
||||
del(config['aws_region'])
|
||||
return Session(**config)
|
||||
|
||||
|
||||
def get_queue(self):
|
||||
self.sqs = self.connection.resource('sqs')
|
||||
return self.sqs.create_queue(QueueName=self.list_key)
|
||||
|
||||
@@ -9,10 +9,10 @@ class IronMQBroker(Broker):
|
||||
return self.connection.post(task)['ids'][0]
|
||||
|
||||
def dequeue(self):
|
||||
timeout = Conf.RETRY or None
|
||||
tasks = self.connection.get(timeout=timeout, wait=1, max=Conf.BULK)['messages']
|
||||
if tasks:
|
||||
return [(t['id'], t['body']) for t in tasks]
|
||||
timeout = Conf.RETRY or None
|
||||
tasks = self.connection.get(timeout=timeout, wait=1, max=Conf.BULK)['messages']
|
||||
if tasks:
|
||||
return [(t['id'], t['body']) for t in tasks]
|
||||
|
||||
def ping(self):
|
||||
return self.connection.name == self.list_key
|
||||
|
||||
@@ -60,7 +60,7 @@ class ORM(Broker):
|
||||
|
||||
def dequeue(self):
|
||||
tasks = self.get_connection().filter(key=self.list_key, lock__lt=_timeout())[
|
||||
0 : Conf.BULK
|
||||
0: Conf.BULK
|
||||
]
|
||||
if tasks:
|
||||
task_list = []
|
||||
|
||||
Reference in New Issue
Block a user