Timer executed multiple times

I have one timer in server code which on deployment using CodeRunner is executed multiple times. I would expect it to run once every minute, but it runs more than once every minute. Sometimes 5, sometimes 7 times. The annotation is as follows:

@BackendlessTimer("{‘startDate’:1441613460000,‘frequency’:{‘schedule’:‘custom’,‘repeat’:{‘every’:60}},‘timername’:‘RefreshEarthquakes’}")

Could you please describe how you validate how many times the timer ran?

Regards,
Mark

I have put in a System.out.println as the first statement of the execute method. It prints in my terminal running CodeRunner a couple of times quickly after each other every minute.

2015-09-11 10:36:09:187: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:09:202: processing 100 earthquakes

2015-09-11 10:36:09:283: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:09:300: processing 100 earthquakes

2015-09-11 10:36:09:378: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:09:393: processing 100 earthquakes

2015-09-11 10:36:09:473: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:09:488: processing 100 earthquakes

2015-09-11 10:36:10:201: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:10:216: processing 100 earthquakes

2015-09-11 10:36:10:296: RefreshEarthquakesTimer.execute called

2015-09-11 10:36:10:311: processing 100 earthquakes

2015-09-11 10:36:23:006: found 0 new earthquake records

2015-09-11 10:36:23:148: found 0 new earthquake records

2015-09-11 10:36:23:291: found 0 new earthquake records

2015-09-11 10:36:23:291: found 0 new earthquake records

2015-09-11 10:36:24:075: found 0 new earthquake records

2015-09-11 10:36:24:203: found 0 new earthquake records

Hi!

Do you have some timers in production (Production tab on console) in the same time?
Regards,
Kate.

Hi.

No server-side code is found in the production deployment for Timers.

Could you send your project with timer and CodeRunner sdk to this email: kate@backendless.com?

I uploaded it in the dropbox account Mark created earlier.

Could you try to add new Backendless app and use server code in it
(just change application id and secret key in runner.properties file and Bootsrap.java)?

Yes that works fine. It also worked ok in my original app before it started today.

Since I have to embed the keys in both Android and iOS apps I would like to know what is causing this timer behavior because I cannot change them easily after release.

I’m investigating this issue.

Maybe you remember steps after which this problem has appeared?
This error http://support.backendless.com/t/coderunner-noclassdeffounderror appeared in this app too?

Ok thanks.

Precise steps I can’t remember. But now I think of it, it already happened yesterday. It started with two or four runs in a row. I didn’t think much of it because I often hit the Run button (once) directly after deploying with CodeRunner to speed up hitting my server code breakpoint. Today it changed to more runs every cycle which seemed odd.

The NoClassDefFoundError was indeed the same app, which was caused by mistakenly deploying an unpacked jar in the libs folder.

We were able to reproduce the problem and created an internal ticket. The problem is caused by executing a timer on demand (using the Run button). If you avoid hitting the button (perhaps in a version of the app you have in production), a timer will be executing strictly in accordance to the prescribed schedule.

Regards,
Mark

Ok thanks for clearing that up. The development is finished for now so I won’t be hitting the Run button soon.

Hi!

This issue already solved.
Please notify us if you have some questions or difficulties.
Regards,
Kate.