celery/kombu — pull request #158 by rmihael (2012-09-11 15:15:48+00:00)
Title: Better index for MongoDB transport

Kombu uses the following query to fetch messages from the queue:

msg = self.client.command('findandmodify', 'messages',
query={'queue': queue},
sort={'_id': pymongo.ASCENDING}, remove=True)

This query combines `queue` and `_id` fields, but current Kombu index only include `queue`. By adding `_id` to the index on messages collection we got better performance in situations when messages queue becomes clogged for any reason.