浏览代码

Merge branch 'master' of github.com:celery/celery

Ask Solem 10 年之前
父节点
当前提交
070730f4a8
共有 7 个文件被更改,包括 16 次插入10 次删除
  1. 1 0
      CONTRIBUTORS.txt
  2. 1 1
      celery/backends/cache.py
  3. 8 3
      celery/backends/mongodb.py
  4. 1 1
      celery/beat.py
  5. 1 1
      celery/result.py
  6. 2 2
      docs/tutorials/task-cookbook.rst
  7. 2 2
      docs/userguide/tasks.rst

+ 1 - 0
CONTRIBUTORS.txt

@@ -176,6 +176,7 @@ Nathan Van Gheem, 2014/10/28
 Gino Ledesma, 2014/10/28
 Thomas French, 2014/11/10
 Michael Permana, 2014/11/6
+William King, 2014/11/21
 Bert Vanderbauwhede, 2014/12/18
 John Anderson, 2014/12/27
 Luke Burden, 2015/01/24

+ 1 - 1
celery/backends/cache.py

@@ -129,7 +129,7 @@ class CacheBackend(KeyValueStoreBackend):
         return self.client.delete(key)
 
     def _apply_chord_incr(self, header, partial_args, group_id, body, **opts):
-        self.client.set(self.get_key_for_chord(group_id), '0', time=86400)
+        self.client.set(self.get_key_for_chord(group_id), 0, time=86400)
         return super(CacheBackend, self)._apply_chord_incr(
             header, partial_args, group_id, body, **opts
         )

+ 8 - 3
celery/backends/mongodb.py

@@ -78,9 +78,14 @@ class MongoBackend(BaseBackend):
 
         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:

+ 1 - 1
celery/beat.py

@@ -21,7 +21,7 @@ from functools import total_ordering
 from threading import Event, Thread
 
 from billiard import ensure_multiprocessing
-from billiard.process import Process
+from billiard.context import Process
 from billiard.common import reset_signals
 from kombu.utils import cached_property, reprcall
 from kombu.utils.functional import maybe_evaluate

+ 1 - 1
celery/result.py

@@ -633,7 +633,7 @@ class ResultSet(ResultBase):
         remaining = None
 
         if on_message is not None:
-            raise Exception('Your backend not suppored on_message callback')
+            raise Exception('Your backend not supported on_message callback')
 
         results = []
         for result in self.results:

+ 2 - 2
docs/tutorials/task-cookbook.rst

@@ -31,7 +31,7 @@ The cache key expires after some time in case something unexpected happens
     from celery import task
     from celery.utils.log import get_task_logger
     from django.core.cache import cache
-    from django.utils.hashcompat import md5_constructor as md5
+    from hashlib import md5
     from djangofeeds.models import Feed
 
     logger = get_task_logger(__name__)
@@ -42,7 +42,7 @@ The cache key expires after some time in case something unexpected happens
     def import_feed(self, feed_url):
         # The cache key consists of the task name and the MD5 digest
         # of the feed URL.
-        feed_url_digest = md5(feed_url).hexdigest()
+        feed_url_hexdigest = md5(feed_url).hexdigest()
         lock_id = '{0}-lock-{1}'.format(self.name, feed_url_hexdigest)
 
         # cache.add fails if the key already exists

+ 2 - 2
docs/userguide/tasks.rst

@@ -1550,7 +1550,7 @@ depending on state from the current transaction*:
 
 .. note::
     Django 1.6 (and later) now enables autocommit mode by default,
-    and ``commit_on_success``/``commit_manually`` are depreacated.
+    and ``commit_on_success``/``commit_manually`` are deprecated.
 
     This means each SQL query is wrapped and executed in individual
     transactions, making it less likely to experience the
@@ -1567,7 +1567,7 @@ depending on state from the current transaction*:
 Example
 =======
 
-Let's take a real wold example; A blog where comments posted needs to be
+Let's take a real world example; A blog where comments posted needs to be
 filtered for spam.  When the comment is created, the spam filter runs in the
 background, so the user doesn't have to wait for it to finish.