mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 19:38:11 +08:00
Adds a MongoDB broker
* adds mongo broker tests * adds mongo brokers docs * broker info is now cached when it needs to connect to a server, to reduce traffic.
This commit is contained in:
@@ -21,7 +21,7 @@ class ORM(Broker):
|
||||
return self.connection.filter(key=self.list_key, lock__lte=_timeout()).count()
|
||||
|
||||
def lock_size(self):
|
||||
return self.connection.filter(key=self.list_key, lock__gte=_timeout()).count()
|
||||
return self.connection.filter(key=self.list_key, lock__gt=_timeout()).count()
|
||||
|
||||
def purge_queue(self):
|
||||
return self.connection.filter(key=self.list_key).delete()
|
||||
@@ -30,7 +30,9 @@ class ORM(Broker):
|
||||
return True
|
||||
|
||||
def info(self):
|
||||
return 'ORM {}'.format(Conf.ORM)
|
||||
if not self._info:
|
||||
self._info = 'ORM {}'.format(Conf.ORM)
|
||||
return self._info
|
||||
|
||||
def fail(self, task_id):
|
||||
self.delete(task_id)
|
||||
|
||||
Reference in New Issue
Block a user