run timer 2 in 2 minutes

run timer 2 in 2 minutes

  
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
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.
Thank nuno. I'll try to use your help!

best regards

Eduardo 
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...
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.