automationrpag1ant

How to make the trigger in G1ANT run every 3 minutes but if its in the middle of a process then let it complete it?


I was told to use crontab expression to make my schedule trigger run every 3 minutes, however, I notice that it's not actually running every 5 minutes, what its doing is it runs a process for a period of 3 minutes and then it stops even if the process is not complete.

I need the trigger to run every 3 minutes but if its in the middle of a process then to complete the current process. Can you advise, please?

I noticed in the schedule trigger you have “start instance” and “stop instance”, currently they are both false. My guess is I need to do something with these?


Solution

  • The triggers never interrupt the script execution.

    The special variable timeout is what will solve your problem. According to the manual the timeout special variable:

    Defines the maximal robot process duration time (in milliseconds), after which the process terminates; the default value is 180000 (3 minutes).

    Which means that a script will stop after 3 minutes if its timeout's variable value stays default.

    Add the below line of code at the beginning of your script to prevent this from happening after 3 minutes and increase its maximal robot process duration time.

    ♥timeout = 1800000
    

    By the way if you have set up your triggers to launch a script every 3 minutes and the script's duration time is for example 4 minutes, the script will be launched the next time automatically after because it is 1 minute late and it creates a queue of scripts to be executed.