Permalink
Browse files

Removes django-picklefield from contrib/requirements/default.txt

  • Loading branch information...
1 parent f83ebaf commit 98f4b6d35e08bf8433784b1c1b3ba49e703d1547 Ask Solem committed Jul 9, 2010
Showing with 20 additions and 1 deletion.
  1. +20 −0 celery/worker/state.py
  2. +0 −1 contrib/requirements/default.txt
View
20 celery/worker/state.py
@@ -3,20 +3,40 @@
from celery.utils.compat import defaultdict
from celery.datastructures import LimitedSet
+# Maximum number of revokes to keep in memory.
REVOKES_MAX = 10000
+
+# How many seconds a revoke will be active before
+# being expired when the max limit has been exceeded.
REVOKE_EXPIRES = 3600 # One hour.
+"""
+.. data:: active_requests
+
+Set of currently active :class:`~celery.worker.job.TaskRequest`'s.
+
+.. data:: total_count
+
+Count of tasks executed by the worker, sorted by type.
+
+.. data:: revoked
+
+The list of currently revoked tasks. (PERSISTENT if statedb set).
+
+"""
active_requests = set()
total_count = defaultdict(lambda: 0)
revoked = LimitedSet(maxlen=REVOKES_MAX, expires=REVOKE_EXPIRES)
def task_accepted(request):
+ """Updates global state when a task has been accepted."""
active_requests.add(request)
total_count[request.task_name] += 1
def task_ready(request):
+ """Updates global state when a task is ready."""
try:
active_requests.remove(request)
except KeyError:
View
1 contrib/requirements/default.txt
@@ -3,5 +3,4 @@ python-dateutil
sqlalchemy
anyjson
carrot>=0.10.5
-django-picklefield
pyparsing

0 comments on commit 98f4b6d

Please sign in to comment.