From 772bcb832b91bdc361beaf3bb775a9f4a481faab Mon Sep 17 00:00:00 2001 From: fatihsucu Date: Thu, 16 Apr 2015 14:31:59 +0300 Subject: [PATCH 1/3] mongodb default options removed. --- celery/backends/mongodb.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/celery/backends/mongodb.py b/celery/backends/mongodb.py index 456ae603447..624807aadd6 100644 --- a/celery/backends/mongodb.py +++ b/celery/backends/mongodb.py @@ -78,9 +78,6 @@ def __init__(self, app=None, url=None, **kwargs): self.url = url - # default options - self.options.setdefault('max_pool_size', self.max_pool_size) - self.options.setdefault('auto_start_request', False) # update conf with mongo uri data, only if uri was given if self.url: From e53e170b629dd5fd45bad64880c7b9ca248f28cb Mon Sep 17 00:00:00 2001 From: fatihsucu Date: Fri, 17 Apr 2015 12:12:50 +0300 Subject: [PATCH 2/3] mongodb backend version controller and defaults added. --- celery/backends/mongodb.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/celery/backends/mongodb.py b/celery/backends/mongodb.py index 624807aadd6..278eb6496c8 100644 --- a/celery/backends/mongodb.py +++ b/celery/backends/mongodb.py @@ -79,6 +79,14 @@ def __init__(self, app=None, url=None, **kwargs): self.url = url + # default options according to pymongo version + if pymongo.version_tuple >= 3: + self.options.setdefault('maxPoolSize', self.max_pool_size) + else: + self.options.setdefault('max_pool_size', self.max_pool_size) + self.options.setdefault('auto_start_request', False) + + # update conf with mongo uri data, only if uri was given if self.url: uri_data = pymongo.uri_parser.parse_uri(self.url) From c0b366d558e9d51c2e5ad62d482eab45e903d7db Mon Sep 17 00:00:00 2001 From: fatihsucu Date: Fri, 17 Apr 2015 12:25:16 +0300 Subject: [PATCH 3/3] fixed type in version controller --- celery/backends/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/celery/backends/mongodb.py b/celery/backends/mongodb.py index 278eb6496c8..1abb1bbe042 100644 --- a/celery/backends/mongodb.py +++ b/celery/backends/mongodb.py @@ -80,7 +80,7 @@ def __init__(self, app=None, url=None, **kwargs): # default options according to pymongo version - if pymongo.version_tuple >= 3: + if pymongo.version_tuple >= (3,): self.options.setdefault('maxPoolSize', self.max_pool_size) else: self.options.setdefault('max_pool_size', self.max_pool_size)