Version 5 (modified by 10 years ago) (diff) | ,
---|
Contents
Scheduled tasks manager
Description
This plugin provides an extension point for trac plugin developers to manager their scheduled tasks. It polls register plugins, and run matched tasks like crontab in linux/unix.
Features will be added to this plugin in next version:
- support crontab format
See:ZoomQuiet ~ Collection KSPEG Trac hacking
Bugs/Feature Requests
Existing bugs and feature requests for TracSchedulerPlugin are here.
If you have any issues, create a new ticket.
defect |
1 / 2 |
---|
Download
Download the zipped source from [download:tracschedulerplugin here].
Source
You can check out TracSchedulerPlugin from here using Subversion, or browse the source with Trac.
Installation
You can install this software as normal Trac plugin.
- Uninstall Trac Scheduler if you have installed it before.
- Change to the directory containing setup.py.
- If you want to install this plugin globally, install this plugin to the Python path:
- python setup.py install
- If you want to install this plugin to one Trac instance only:
- python setup.py bdist_egg
- copy the generated egg file to the trac instance's plugins directory
cp dist/*.egg /srv/trac/env/plugins
- Configure your
trac.ini
file:[components] tracscheduler.* = enabled [tracscheduler] ; tasks poll interval is 60 sec poll_interval = 60 ; task invoke interval is 1 sec worker_interval = 1
Example
This set up will log the latest 2 ticket ids every minute:
from tracscheduler.web_ui import IScheduledTask class TracSchedulerTest(Component): implements(IScheduledTask) def process_scheduled_task(self, parent): self.log.debug("TracSchedulerTest") sqlString = "SELECT id FROM ticket ORDER BY id DESC LIMIT 2;" rows = parent.queryDb(sqlString) self.log.debug(rows)
Recent Changes
Author/Contributors
Author: richard
Maintainer: Richard Liao
Contributors: