Skip to content

Commit

Permalink
mongodb backend version controller and defaults added.
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihsucu committed Apr 17, 2015
1 parent 772bcb8 commit e53e170
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions celery/backends/mongodb.py
Expand Up @@ -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)
Expand Down

0 comments on commit e53e170

Please sign in to comment.