The task runner now deletes old processed bounce events.
[mailman.git] / src / mailman / runners / docs / task.rst
blob95cc57f6aafd84ec5d99d903d8f4b1b799ad93d6
1 ===============
2 The Task runner
3 ===============
5 Mailman has a Task runner that executes periodic tasks.
8 Configuration
9 =============
11 By default, the Task runner executes tasks once per hour to evict expired
12 pending requests, bounce events and cache entries and to delete any saved
13 workflow states and saved message store messages orphaned by deleting the
14 associated pending request.  This timing is configurable in the ``[mailman]``
15 section of the configuration.::
17     # mailman.cfg
18     [mailman]
19     run_tasks_every: 1d
21 This will run the tasks once per day instead of once per hour.
24 Logging
25 =======
27 The Task runner writes some simple log messages to a new task log.
29     >>> import doctest
30     >>> doctest.ELLIPSIS_MARKER = 'xxx'
31     >>> from mailman.testing import helpers
32     >>> from mailman.config import config
33     >>> from mailman.runners.task import TaskRunner
34     >>> mark = helpers.LogFileMark('mailman.task')
35     >>> runner = helpers.make_testable_runner(TaskRunner)
36     >>> runner.run()
37     >>> print(mark.read())
38     xxx Task runner evicted 0 expired pendings
39     xxx Task runner deleted 0 orphaned workflows
40     xxx Task runner deleted 0 orphaned requests
41     xxx Task runner deleted 0 orphaned messages
42     xxx Task runner evicted 0 expired bounce events
43     xxx Task runner evicted expired cache entries
44     <BLANKLINE>
45     >>> doctest.ELLIPSIS_MARKER = '...'