cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop running task after certain time

Mahesh7225
New Contributor

How to stop running task after certain time

I have scheduled job every day but want to stop that job after certain time(eg.after 4hrs) on every day.

8 REPLIES 8

Here is the snap of the cron job for your reference:

image

Again, I’m not sure whether you have been using this or not, sharing it ahead of time if this is what you were looking for.

Also, to reiterate @koryknick’s point, timeout works every single time. Please ensure that timeout is in minutes so if you want the job to stop after 3hours, you put 180m in there.

I have never faced any issues with Timeout yet so you may want to try that out again and requesting you to share the screenshots of the what you have kept and email notification received even after timeout was set correctly but didn’t work (this is a very strange behavior and I’m inclined to believe that timeout will work 100% everytime)

Thanks!

I tried this option but its not working

pmancevski
New Contributor III

Hi @Mahesh7225,

I don’t think is possible automatically to stop some process, but depending of your logic in the process you can control when to stop.

Example: You are querying some DB. You will have to make a copy of the same process, and also you will need to modify the process at the beginning to check if the time is 5PM (router or filter). After that at the end to call the copied process or original.

  1. The process is scheduled to start at 2PM.
  2. If the criteria is satisficed (5PM) then continue with the process, if not then end.
  3. Then you need to call the copied process or vice versa.

I hope this will help.

Thanks,
Pero M.