mirror of https://github.com/celery/kombu.git
Fixing MongoDB backend to work properly with TTL (#1076)
* Fixing MongoDB backend to work properly with TTL Bumping pymongo version to 3.8.0 * Updating authors * Adding dependencies to travis config * Fixing travis test cases * Changing pymongo version to align with mongo result backend
This commit is contained in:
parent
193054d243
commit
0ad7d08c4c
|
@ -9,16 +9,19 @@ env:
|
|||
stages:
|
||||
- test
|
||||
- lint
|
||||
|
||||
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- python: 2.7
|
||||
env: TOXENV=2.7
|
||||
before_install: sudo apt-get update && sudo apt-get install libgnutls-dev
|
||||
- python: 3.5
|
||||
env: TOXENV=3.5
|
||||
before_install: sudo apt-get update && sudo apt-get install libgnutls-dev
|
||||
- python: 3.6
|
||||
env: TOXENV=3.6
|
||||
before_install: sudo apt-get update && sudo apt-get install libgnutls-dev
|
||||
- python: 3.7
|
||||
env: TOXENV=3.7-linux
|
||||
sudo: true
|
||||
|
@ -39,6 +42,7 @@ matrix:
|
|||
- python: '3.6'
|
||||
env: TOXENV=apicheck
|
||||
stage: lint
|
||||
before_install: sudo apt-get update && sudo apt-get install libgnutls-dev
|
||||
- python: '3.6'
|
||||
env: TOXENV=pydocstyle
|
||||
stage: lint
|
||||
|
|
1
AUTHORS
1
AUTHORS
|
@ -87,6 +87,7 @@ Luyun Xie <2304310@qq.com>
|
|||
Mads Jensen <https://github.com/atombrella>
|
||||
Mahendra M <Mahendra_M@infosys.com>
|
||||
Marcin Lulek (ergo) <info@webreactor.eu>
|
||||
Marcin Puhacz <marcin.puhacz@gmail.com>
|
||||
Mark Lavin <mlavin@caktusgroup.com>
|
||||
markow <markow@red-sky.pl>
|
||||
Matt Wise <wise@wiredgeek.net>
|
||||
|
|
|
@ -20,6 +20,8 @@ from kombu.utils.json import loads, dumps
|
|||
from kombu.utils.objects import cached_property
|
||||
|
||||
from . import virtual
|
||||
from .base import to_rabbitmq_queue_arguments
|
||||
|
||||
|
||||
E_SERVER_VERSION = """\
|
||||
Kombu requires MongoDB version 1.3+ (server is {0})\
|
||||
|
@ -286,6 +288,9 @@ class Channel(virtual.Channel):
|
|||
options['readpreference'] = modes[options['readpreference']]
|
||||
return options
|
||||
|
||||
def prepare_queue_arguments(self, arguments, **kwargs):
|
||||
return to_rabbitmq_queue_arguments(arguments, **kwargs)
|
||||
|
||||
def _open(self, scheme='mongodb://'):
|
||||
hostname, dbname, conf = self._parse_uri(scheme=scheme)
|
||||
|
||||
|
@ -427,11 +432,9 @@ class Channel(virtual.Channel):
|
|||
return
|
||||
|
||||
self.routing.update(
|
||||
{'queue': queue}, {'$set': {'expire_at': expire_at}},
|
||||
multiple=True)
|
||||
{'queue': queue}, {'$set': {'expire_at': expire_at}}, multi=True)
|
||||
self.queues.update(
|
||||
{'_id': queue}, {'$set': {'expire_at': expire_at}},
|
||||
multiple=True)
|
||||
{'_id': queue}, {'$set': {'expire_at': expire_at}}, multi=True)
|
||||
|
||||
def get_now(self):
|
||||
"""Return current time in UTC."""
|
||||
|
|
|
@ -1 +1 @@
|
|||
pymongo>=2.6.2,<3.0
|
||||
pymongo>=3.3.0
|
||||
|
|
|
@ -418,7 +418,7 @@ class test_mongodb_channel_ttl(BaseMongoDBChannelCase):
|
|||
'routing', 'update',
|
||||
{'queue': 'foobar'},
|
||||
{'$set': {'expire_at': self.expire_at}},
|
||||
multiple=True,
|
||||
multi=True,
|
||||
)
|
||||
|
||||
def test_put(self):
|
||||
|
@ -499,13 +499,13 @@ class test_mongodb_channel_ttl(BaseMongoDBChannelCase):
|
|||
'routing', 'update',
|
||||
{'queue': 'foobar'},
|
||||
{'$set': {'expire_at': self.expire_at}},
|
||||
multiple=True,
|
||||
multi=True,
|
||||
)
|
||||
self.assert_operation_called_with(
|
||||
'queues', 'update',
|
||||
{'_id': 'foobar'},
|
||||
{'$set': {'expire_at': self.expire_at}},
|
||||
multiple=True,
|
||||
multi=True,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue