Forum Discussion

Mahesh7225's avatar
Mahesh7225
New Contributor
3 years ago

How to stop running task after certain time

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

  • I believe you are looking for the TImeout setting of the Task:

    • darshthakkar's avatar
      darshthakkar
      Valued Contributor

      Agreed with @koryknick

      @Mahesh7225: What time your job has been scheduled? How would you want to stop that? 4hrs after the execution or 4hrs after trying to run that job?

      Thanks!

      • Mahesh7225's avatar
        Mahesh7225
        New Contributor

        i have scheduled job every day at eg. 2pm and after job started it should automatically stop at 5pm on that day, but next day it should be start at 2pm as per schedule

  • pmancevski's avatar
    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.