Timer/Send Email code incorrectly sending 2 emails instead of one.

First up, I’d like to say how much I’m enjoying using Backendless, especially now I have almost got the hang of reading writing data and writing my own server scripts. I feel it gives me a lot of power that was otherwise very hard to come by and I’m looking forward to upgrading plans once I go live with my app. I’d also like to thank you guys for all the support so far.
Anyway, I have a timer which spits out an email every 24 hours. When I invoke the timer manually (using timers/invoke timer) I correctly get just one email, however, when I leave the timer to run on its own, I get 2 emails each time the timer script is run (sent at exactly the same time). How could this be?
Thanks

Hi Simon,

This is not the first issue we get reported when the timers runs twice instead of once, so there’s definitely a problem somewhere. We are already working on finding a it, but it’s really tricky to track. So the best solution for now would be for you to implement some kind of check in your timer’s code whether the email hasn’t been sent for the last N hours, since unfortunately we cannot yet say when the original problem will be fixed.

The only thing I could imagine/guess is that somehow its running the ‘draft’ timer at the same time. (?) I don’t really understand why the business logic/timers tab shows two timers…

http://support.backendless.com/public/attachments/2cae56151ed1d3d5a58d454b4ed7f285.png</img>

If you’re not debugging currently, you may safely remove the debug timer. Probably it hasn’t been cleaned when you disconnected your local coderunner.

Oddly, I’m now receiving one email (correctly) instead of two. The only thing I changed was my timer to run every 24 hours rather than every 6000 seconds. (?!)…or maybe you guys changed something on Backendless?

Probably resetting the timer helped. We haven’t changed anything on our side yet.

Hi, today I added two more timers to the same script. Each of these new timers is sending two emails instead of one. When I run the timer manually (using the timer invoke button on your site) only one email is correctly sent. There is still something not working here. How can I reset the new timers?

Getting two emails instead of one is most probably not the same problem as getting one instead of two. So I’d suggest you to create a separate topic for this new one for us to be able to better track it.

Also please provide the code of your timer in that new topic, because it looks like the problem is in your code not sending the second email under particular circumstances (exceptions, invalid async handling etc.)

Hmm, well 12 hours later it seems to have ironed itself out again. (Now I’m getting correctly one email for each timer) Maybe it’s because I closed Chrome or something overnight ??

Note: previously it was 2 emails instead of one (ie the same problem as before)