Developer forum

Forum » Integration » Scheduled Tasks are not running according to their scheduled time

Scheduled Tasks are not running according to their scheduled time

Asim Shahzad
Reply

Hi,

We are using DW 9.4.14 and we have 3 Scheduled tasks which need to run after every five minutes. These three tasks need to run in a specific order but for some reason they all run at the same time after 5 minutes. The reason why they need to run in a specific order is that these schedlued tasks needs input or out out from each other. 

I have a windows task which runs after every 5 minutes and runs the "TaskExecute.aspx".

See the attached image.

Please let me know if i am doing something wrong or there is anyother way to get this behavior.

 

 

 

Capture.PNG

Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Asim,
the several tasks can not be run at the same time, they are running one after another. They are running in the order they are present in the [ScheduledTask] database table (ordered by TaskId),
so you could check if your tasks order is correct in the database by going to Settings->Integration->Sql firehouse and run: "select * from [ScheduledTask]".
If the order is not correct then you need to recreate them in the needed order(copy existing in the correct order and delete old).
Regards, Dmitrij

 
Asim Shahzad
Reply

Hi Dmitriy,

Thanks for your reponse.  Corect me if i am worng, i happend to find the TaskExecute.aspx.vb(Ver. 9.4.6). This is the file which gets all the batches from the "ScheduledTask" and run them according to how they are configured.

I found the sql in the same file which gets all the scheduled tasks and they are run afterwards, below is the query,

"select * from [ScheduledTask] where [TaskBegin] <= {0} and [TaskEnd] > {0} and [TaskNextRun] <= {0} and [TaskEnabled]={1}", Database.SqlDate(Date.Now), Database.SqlBool(True)))"

According to what you have described, i am unable to find anything which is related to "Task Order". Do you have any link to the information you gave me ?

Also in the same file they are not using "Asynchronous" calls, so i higly doubt they are run any order.

Regards

Asim Shahzad

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Asim,
you have found correct sql, so you are welcome to run it via the SQL firehouse and see the Ids of your tasks, so they run in the order they are present/returned in/from the [ScheduledTask] table.For example: the task with id=1 will run first, task with id=2 will run after. So check your tasks Ids and see if their values corresponds to the order you want them to run.
You can also check the log of the executing tasks in the: Files\System\Log\ScheduledTasks folder.
Regards, Dmitrij

Votes for this answer: 1
 
Asim Shahzad
Reply

Hi Dimitriy,

You are correct, now batches are runing in a sequence. Thanks

 

You must be logged in to post in the forum