โ09-20-2022 03:04 AM
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.
โ09-20-2022 06:59 AM
Here is the snap of the cron job for your reference:
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.
โ09-20-2022 07:02 AM
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!
โ09-20-2022 06:29 AM
I tried this option but its not working
โ09-21-2022 02:04 AM
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.
I hope this will help.
Thanks,
Pero M.