Skip to content

Commit

Permalink
Merge pull request celery#2580 from fatihsucu/hotfix_for_pymongo
Browse files Browse the repository at this point in the history
Mongodb default options update in 3.0
  • Loading branch information
PMickael committed Apr 17, 2015
2 parents 1159b3a + c0b366d commit 580ce0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions celery/backends/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ 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)

# 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:
Expand Down

0 comments on commit 580ce0e

Please sign in to comment.