• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Using the ColdFusion Scheduler > Additional Considerations

22.3. Additional Considerations

As useful as the ColdFusion Scheduler is, it does have its limitations. One of the most notable limitations of the Scheduler is that there is no built-in redundancy. That is, if a scheduled task fails to execute for whatever reason (say the server is down) the Scheduler has no way of knowing this condition, and only attempts to execute the task again the next time it is scheduled for execution.

It is possible to build redundancy into your scheduled tasks, but it takes work. One solution involves creating a small database that contains a record for each entry in the Scheduler. Each time you execute a scheduled task, you CFINCLUDE a file or call a custom tag that updates a field in the database with the time and date that the task should be executed next. A second template scans the database of scheduled tasks and checks to make sure none of the tasks have a time/date for next execution that is older than the current time/date. If so, you know that the task didn't execute for some reason, and you can call the CFSCHEDULE tag to immediately try to run that task again. The template that performs the scan should itself be scheduled to run at an interval that is appropriate for your particular needs (i.e., every 15 minutes, every 30 minutes, etc.).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint