= Scheduled tasks manager = [[TOC]] SEE:'''ZoomQuiet''' ~ Collection KSPEG Trac hacking == 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 == Bugs/Feature Requests == Existing bugs and feature requests for TracSchedulerPlugin are [report:9?COMPONENT=TracSchedulerPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=TracSchedulerPlugin&owner=richard new ticket]. == Download == Download the zipped source from [download:tracschedulerplugin here]. == Source == You can check out TracSchedulerPlugin from [http://trac-hacks.org/svn/tracschedulerplugin here] using Subversion, or [source:tracschedulerplugin browse the source] with Trac. == Install == You can install this software as normal Trac plugin. 1. Uninstall Trac Scheduler if you have installed before. 2. Change to the directory containning setup.py. 3. If you want to install this plugin globally, that will install this plugin to the python path: * python setup.py install 4. If you want to install this plugin to trac instance only: * python setup.py bdist_egg * copy the generated egg file to the trac instance's plugin directory {{{ cp dist/*.egg /srv/trac/env/plugins }}} 5. Config trac.ini: {{{ [components] tracscheduler.* = enabled [tracscheduler] ; tasks poll interval is 60 sec poll_interval = 60 ; task invoke interval is 1 sec worker_interval = 1 }}} == Example == This following plugin will logging the latest 2 ticket ids every 1 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 == [[ChangeLog(tracschedulerplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:richard] [[BR]] '''Contributors:'''