summaryrefslogtreecommitdiff
path: root/kombu/transport/mongodb.py
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2011-04-21 18:33:15 +0200
committerAsk Solem <ask@celeryproject.org>2011-04-21 18:33:15 +0200
commita10c9ee44b7fe39eac135d9e5201072917b0fa96 (patch)
treefc099ecc074b72dfc78544ba947c3a5432875553 /kombu/transport/mongodb.py
parent1606cd96a00eb23cf4b1fd6c3b5cf7da0836abe3 (diff)
parent90c2934e0abcc336f300cf834e3130ab8cce8280 (diff)
downloadkombu-a10c9ee44b7fe39eac135d9e5201072917b0fa96.tar.gz
Merge branch 'master' of github.com:ask/kombu
Conflicts: kombu/transport/mongodb.py
Diffstat (limited to 'kombu/transport/mongodb.py')
-rw-r--r--kombu/transport/mongodb.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kombu/transport/mongodb.py b/kombu/transport/mongodb.py
index 37f4028c..98a4b879 100644
--- a/kombu/transport/mongodb.py
+++ b/kombu/transport/mongodb.py
@@ -11,8 +11,9 @@ MongoDB transport.
"""
from Queue import Empty
-from anyjson import serialize, deserialize
+import pymongo
from pymongo import errors
+from anyjson import serialize, deserialize
from pymongo.connection import Connection
from kombu.transport import virtual
@@ -32,7 +33,7 @@ class Channel(virtual.Channel):
def _get(self, queue):
try:
msg = self.client.database.command("findandmodify",
- "messages", query={"queue": queue}, remove=True)
+ "messages", query={"queue": queue}, sort={'_id' : pymongo.ASCENDING }, remove=True)
except errors.OperationFailure, exc:
if "No matching object found" in exc.args[0]:
raise Empty()