The ScheduledTask model offers a wrapped caller for a task that manages time commitments for the scheduling. If the task is not recurring and called manually, it will not run when it is scheduled (it will be considered run and not run again). The object is also comparable to datetime objects to determine if the next targetted runtime has been reached.
Setup one time or recurring scheduled task
Will attempt to figure out the next time the action should be run and return a task to be added to the pool. If an absolute time is provided it will attempt to figure out the next time that time will occur, the time can be any of date, time, or datetime. If it is in the past, it will figure out the next logical time to run it.
If no absolute time is provided, the relative time from when the task is scheduled will be used.
If recurring is True. A relative value will be calculated if not provided and will be added to the current time for the next run after each time the task is run. So if it runs at midnight and then a delta of 1 hour, it will run every hour from midnight on.
This example will print o'clock every hour after midnight.
Parameters: |
|
---|