Executes Jobs periodically at a specific point in time and repeats this at a time-interval

by
Odoo
v 6.1 v 7.0 v 8.0 Third Party 660
Download for v 6.1
Technical Name timed_job
LicenseSee License tab
Websitehttp://www.swing-system.com
Repositorylp:~camptocamp/c2c-rd-addons/6.1
Also available in version v 8.0 v 7.0
You bought this module and need support? Click here!

Executes job at a specific point in time and repeats this at a time-interval.

Main features:
  • Executes a function "Function" on object "Object" with arguments "Arguments"
  • Starts the function at precise time "Start Time" (or on following periods, see below)
  • Periodic execution according to specified, precise intervals (see below)
  • Jobs may be executed in parallel, according to their start time
  • Double-start protection (do not execute the same job more than once in parallel)
  • The termination of the last successfull execution is stored ("Last Execution Time")
  • Jobs are terminated when the server terminates
  • Insertion, deletion of jobs take immediate effect
  • Optionally, the missed executions can be repeated after a server outage ("Repeat Missed")
  • Optionally, a fixed number of execution times can be specified ("Number of Calls")
  • Optionally, a notification mail will be sent in case of errors
  • Optionally, an execution dependency between jobs during server-startup can be specified ("Startup Predecessor") This specifies the job that has to be executed in advance during a server-startup.
Interval Types:
  • 'Minutes' : Jobs are executed at "Interval Number" minutes relative to "Start Time"
  • 'Hours' : Jobs are executed at "Interval Number" hours relative to "Start Time"
  • 'Days' : Jobs are executed at "Interval Number" days at "Start Time"
  • 'Days of Week' : Jobs are executed at specified weekday (according to ISO-numbering: 1=monday, 2=tuesday, ..., 7=sunday) at "Start Time"
  • 'Days of Month' : Jobs are executed at specified day of month at "Start Time" (1=first day, 2=second day, -1=ultimo).

Notes: Carefully planned time-triggered jobs can be very resource-efficient.

When using interval type 'Days', it is assumed that the start day is irrelevant. Note that - depending on the calendar and on the interval - this day will shift anyway over years. The implementation calculates the interval relative to the "Last execution time". Therefore, by deleting/reinserting of a job this day can be specified.

With "Startup Predecessor" complex dependency trees can be specified. Circular dependencies are (obviously) not allowed.

"Repeat Missed" and "Startup Predecessor" have a necessary - but not obvious - drawback: During server startup, those jobs have to be executed prior to any other job - this may take a long time. Use those features judiciously.

Depending on the log_level of the server, information (elapsed time / CPU time) about the executed jobs are written to the server log.

The specified 'Function' must be known to the 'Object'.

The object 'Timed Job' provides two convenience functions for testing and sanity:
  • test(self, cr, uid, args=[]) : for testing - args[0] is a floating point number of seconds that this function will last - args[1] is a String that will be written to the server log
  • thread_watchdog(self, cr, uid, args=[]) : checks all threads and their states and writes anomalies to the server log
Programmatic interface :
  • _time_granule: A datetime.timedelta (default 10sec) that specifies the sparse time base (a value of 0 will not work!)
  • _max_scheduler_delta: A datetime.timedelta (default 6hours) that specifies the maximum interval for the scheduler to be executed
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.