Changes between Version 11 and Version 12 of TracCronPlugin


Ignore:
Timestamp:
Oct 18, 2010, 6:37:02 PM (13 years ago)
Author:
Thierry Bressure
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracCronPlugin

    v11 v12  
    4545    """
    4646   
    47     def wake_up(self):
     47    def wake_up(self, *args):
    4848        """
    4949        Call by the scheduler when the task need to be executed
     
    7676    implements(ICronTask)
    7777   
    78     def wake_up(self):
    79         self.env.log.debug("Heart beat: boom boom !!!")
     78    def wake_up(self, *args):
     79        if len(args) > 0:
     80            for arg in args:
     81                self.env.log.debug("Heart beat: " + arg)
     82        else:
     83            self.env.log.debug("Heart beat: boom boom !!!")
    8084   
    8185    def getId(self):
     
    107111heart_beat.daily = 21h19, 21h20
    108112heart_beat.daily.enabled = True
     113hear_beat_daily.arg = Good Morging
    109114heart_beat.enabled = True
    110115heart_beat.hourly = 17, 18
     
    138143For each task loaded by Trac Component manager, Trac Cron Plugin have those parameters. Let's look at hear beat task:
    139144
     145==== Enable/Disable a task ====
     146
    140147
    141148{{{
     
    146153This is the second way to enable or disable a task. Since ''ticker_enabled'' is global and so all task will be affected, this key only affect one task. If False, wathever schedule the task have, no one will be trigged, so this is a way to disable a task while keep all the schedule in place for the time you will enable the task. Default is '''True'''.
    147154
     155
     156==== Task scheduling ====
     157
    148158{{{
    149159#!ini
     
    153163This control the daily scheduler. As this name suggest, it trigger the task every day. You need to provide time you want the task to execute. You can give a comma separated list to trigger the task at multiple time everyday. Default is no value.
    154164
     165
     166{{{
     167#!ini
     168heart_beat.hourly = 17, 18
     169}}}
     170
     171The goal of this scheduler is to trigger task every hours. You provode minute when you want the task to be executed. Accept comma sparated list of values. Default is no value.
     172
     173
     174{{{
     175#!ini
     176heart_beat.monthly = 15@21h15, 15@21h16
     177}}}
     178
     179This sceduler trigger task that need to be executed once a month. You provide the day in month and the hour when the task will be launched. The day is the index of the day starting at 1. Accept comma separated value. Default is no value
     180
     181
     182{{{
     183#!ini
     184heart_beat.weekly = 4@21h28, 4@21h29
     185}}}
     186
     187This sceduler trigger task that need to be executed once a week. You provide the day in week and the hour when the task will be launched. The day is the index of the day starting at 0 (Monday is 0). Accept comma separated value. Default is no value
     188
     189==== Enable/Disable a schedule ====
     190
     191Each schedule can individualy be enabled or disabled. This the configuration for daily scheduler:
     192
    155193{{{
    156194#!ini
     
    158196}}}
    159197
    160 This enable or disable the daily trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
    161 
    162 {{{
    163 #!ini
    164 heart_beat.hourly = 17, 18
    165 }}}
    166 
    167 The goal of this scheduler is to trigger task every hours. You provode minute when you want the task to be executed. Accept comma sparated list of values. Default is no value.
    168 
    169 {{{
    170 #!ini
    171 heart_beat.hourly.enabled = False
    172 }}}
    173 
    174 This enable or disable the daily trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
    175 
    176 {{{
    177 #!ini
    178 heart_beat.monthly = 15@21h15, 15@21h16
    179 }}}
    180 
    181 This sceduler trigger task that need to be executed once a month. You provide the day in month and the hour when the task will be launched. The day is the index of the day starting at 1. Accept comma separated value. Default is no value
    182 
    183 {{{
    184 #!ini
    185 heart_beat.monthly.enabled = False
    186 }}}
    187 
    188 This enable or disable the daily trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
    189 
    190 {{{
    191 #!ini
    192 heart_beat.weekly = 4@21h28, 4@21h29
    193 }}}
    194 
    195 This sceduler trigger task that need to be executed once a week. You provide the day in week and the hour when the task will be launched. The day is the index of the day starting at 0 (Monday is 0). Accept comma separated value. Default is no value
    196 
    197 {{{
    198 #!ini
    199 heart_beat.weekly.enabled = False
    200 }}}
    201 
    202 This enable or disable the daily trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
     198This enable or disable the trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
     199
     200==== Pass argument to a task ====
     201
     202You can pass argument to the task in a per schedule basis. Here an example for daily schedule:
     203
     204{{{
     205#!ini
     206hear_beat_daily.arg = Good Morging
     207}}}
     208
     209When the daily schedule will trigger the task, the value of the kay will be passed to the '''wake_up''' call. Parameters can be coma separated multiple value. Default is '''empty'''
     210
    203211
    204212== Recent Changes ==