September 12, 2019
Is there a way to define scheduled task execution time to the specific seconds?
Comments
(2)
September 12, 2019
Is there a way to define scheduled task execution time to the specific seconds?
Newbie 3 posts
Followers: 0 people
(2)

Hi All,

Is there a way to define scheduled task execution time to the specific seconds?

The idea is to have multiple tasks executing at the same interval, but the time of execution is spread out.

Currently, I have 3 different scheduled tasks that execute every 30 seconds. Each task takes the result of the previous task to create an outcome.

All 3 tasks will execute bang on the minute/half minute (ie, :00 or :30)

For example:

  • 1st task executes at 12:01:00
  • 2nd task executes at 12:01:30
  • 3rd task executes at 12:02:00

This means there is a minimum of 60 seconds between an input on Task 1 and an output from Task 3.

I’d like to have all 3 tasks to be running every 30 seconds, with a 10 second interval between each task. The final result would be:

  • 1st task executes at 12:01:00
  • 2nd task executes at 12:01:10
  • 3rd task executes at 12:01:20
  • 1st task executes again at 12:01:30
  • 2nd task executes again at 12:01:40
  • 3rd task executes again at 12:01:50
  • etc

This would result in a minimum of 20 seconds between input on task 1 and an output from task 3.

Is there any way of configuring this through ColdFusion administrator?

Thanks.

2 Comments
2019-09-17 16:57:31
2019-09-17 16:57:31

Tagging onto what Hemi345 suggested, the `<cfschedule />` has an `onComplete` attribute you can use to chain tasks which would probably give you much more reliable results.

Like
2019-09-16 20:46:43
2019-09-16 20:46:43

You can schedule each Start Time to be 10 seconds apart (12:00:00,12:00:10,12:00:20) and repeat every 30 seconds.

Wouldn’t it be better to chain the tasks together programmatically so on completion of Task 1, it calls Task 2, and completion of Task 2, it calls Task 3?  Then you’d only need to schedule Task 1 to repeat every 30 seconds, starting at 12:00:00 and your final result could be ready much quicker.

 

 

Like
(1)
Add Comment