Browse Source

Merge branch '3.0'

Ask Solem 12 years ago
parent
commit
8b6e13fe94
2 changed files with 34 additions and 1 deletions
  1. 1 1
      docs/getting-started/next-steps.rst
  2. 33 0
      docs/userguide/monitoring.rst

+ 1 - 1
docs/getting-started/next-steps.rst

@@ -204,7 +204,7 @@ is the name of the module, and the attribute name comes last.
 If a package name is specified instead it will automatically
 try to find a ``celery`` module in that package, and if the name
 is a module it will try to find a ``celery`` attribute in that module.
-This means that these are all equal:
+This means that these are all equal::
 
     $ celery --app=proj
     $ celery --app=proj.celery:

+ 33 - 0
docs/userguide/monitoring.rst

@@ -263,6 +263,39 @@ The events also expire after some time, so the database doesn't fill up.
 Successful tasks are deleted after 1 day, failed tasks after 3 days,
 and tasks in other states after 5 days.
 
+.. _monitoring-django-reset:
+
+Resetting monitor data
+~~~~~~~~~~~~~~~~~~~~~~
+
+To reset the monitor data you need to clear out two models::
+
+    >>> from djcelery.models import WorkerState, TaskState
+
+    # delete worker history
+    >>> WorkerState.objects.all().delete()
+
+    # delete task history
+    >>> TaskState.objects.all().update(hidden=True)
+    >>> TaskState.objects.purge()
+
+.. _monitoring-django-expiration:
+
+Expiration
+~~~~~~~~~~
+
+By default monitor data for successful tasks will expire in 1 day,
+failed tasks in 3 days and pending tasks in 5 days.
+
+You can change the expiry times for each of these using
+adding the following settings to your :file:`settings.py`::
+
+    from datetime import timedelta
+
+    CELERYCAM_EXPIRE_SUCCESS = timedelta(hours=1)
+    CELERYCAM_EXPIRE_ERROR = timedelta(hours=2)
+    CELERYCAM_EXPIRE_PENDING = timedelta(hours=2)
+
 .. _monitoring-nodjango:
 
 Using outside of Django