301
Views
4
Comments
run timer 2 in 2 minutes
Question
Hi All.

I need to run a timer 2 in 2 minutes during the whole day, but I can only run 5 in 5 minutes. 
 
How can I do? 
 
best regards

Eduardo
2016-04-22 00-29-45
Nuno Reis
 
MVP
You can't, but here are some tricks.

Lazy way:
Call the action 5 times inside another action, with 4 two minutes Sleeps between calls (you can get Sleep from extension Sleep).
Adjust those two minutes so that they don't overlap.

Better way:
At the end of the Action, use the Wake action that every timer has, to call the timer again. I think it takes 20 seconds to revive, so add a Sleep of 100 more seconds (again, or less). Create a safety so it doesn't run for more that half an hour or so. That way if it fails, it will start again soon.


There are many more ways, but remember it will consume a lot of resources from the server.
UserImage.jpg
Eduardo Caetano
Thank nuno. I'll try to use your help!

best regards

Eduardo 
2020-03-05 15-52-45
André Vieira
Staff
Hi Eduardo,

Why do you need a timer running every 2 minutes? You must be aware that timers are not guaranteed to run on intended schedule, it depends on a lot of things namely the availability of the server...
2024-06-12 10-07-10
Daniel Martins
Hi Eduardo,
 
If you want to make sure that the 2 min are accomplished I suggest you to expose the timer action in a webservice and call that webservice from other Java/.NET component where you can schedule and trigger that Webservice call in every 2 min.
 
Hope it helps you.
 Kind regards.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.