Hello community,
I've seen many posts but I still don't know what is the best solution to stop a running timer (there is no site property force stop).
Hello Douglas, see this post
https://www.outsystems.com/forums/discussion/3548/stop-a-timer/
I've been through all these posts
https://www.outsystems.com/forums/Search.aspx?page=1&q=stop+timer&scat=forumsI would like to know what is the best solution, given the experience obtained over the years
Hello Douglas,
yes you can add your logic for stop timer-
1. Add site property like StopTime as boolean type set default no
2. use this site property on timer first check if it is yes than update ossys_cyclic_job entity nextrun is null (the timer will never run)
3., if it is no then timer will run accrodingly.
Also you can add logic accrodingly.
Hope this will help you.
just sharing on my case that I needed to stop some long running timer. The timer was not get killed and was shown as running for 6 hours even though it had exceeded the timeout. The timer execution also was not shown in the timer log.
FYI, my timer design does not have any kill switch and i could not restart the IIS in my production server. You may also reduce the timeout setting to lesser value if you need to stop the timer from running any task.
In my case, in the service center, I added some new adhoc schedule in the timer. When the adhoc schedule started, it triggered to stop the pending long running timer. In the timer reports, the timer eventually shown as completed.
In the error log, the error stack showed as "Recovering timer xxx execution. It is marked as running for too long" with the stack as "Marked as running since 19/9/2023 8:10:07 AM (425.189166666667 minutes) by hubnode '?'. Timeout defined is xx minutes"
Hope this helps
Hey there Douglas,
In my experience the best solution to stop a timer is:1- Program an IF at the start of the timer, using a site property named, for example, "StopTimer" with the default value to TRUE, so when it's true the timer does nothing. Then publish the module. After the module finished publishing you are guaranteed that no NEW instances of the timer will be able to run.
2- In order for you to stop the current instance (the one that's running), simply go to the application server, enter IIS, go to Application pools and STOP the pool that the module which contains the timer is running on (be aware that pool can contain many other modules and you will stop all modules from running too);
NOTE: Ideally your module's application pools should be different than the Service Center application pool. That way, since you didn't stop the Service Center pool, you can still monitor everything in Service Center.
After stopping the module application pool, wait 5 minutes and start it again. If the platform tries to restart the timer, it will run the new code with the site property.