Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Olivier Carneiro
0
Views
0
Comments
What if a timer does not run, if you set schedule through its runtime property?
Question
Cenario:
-A timer has no schedule assigned
-The «next run» of the timer is dynamically assigned at runtime, throught its schedule runtime property
In this cenario, the timer may stop waking up. How?
Supose you want the timer to run every 5 minutes. Each time the timer wakes up, you can assign its schedule, for example «Timers.MyTimer.Schedule» as «Substr( AddMinutes(CurrTime() , 5 ),11,5)».
But what if a SQL connection problem occurs (timeout, network problem, whatever) and the execution is aborted? The schedule will not be updated, causing that your timer will only start running from within 24hours. Why? Because the Schedule has a time value lower than the last run.
Let's instanciate:
-schedule has set to 13:00
-Timer waked up at 13:00:10
-The timer action assigned the timer schedule to 13:05, but a SQL problem occurred and the transaction was aborted, so the schedule wasn't set.
In this situation, the timer will only wake tomorrow at 13:00.
What is the solution?
The solution is to create a schedule that is a «time window» over the timer timeout. That is, for the above example the schedule shall be assigned with «13:05 13:10 13:15 13:20 13:25 13:30», assuming the default timer timeout of 20 minutes. This way, whether your timer fails or not, it will always wake up again.
Good work,
Olivier Carneiro
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...