SmartFox Task Scheduler

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
ekrem5353
Posts: 118
Joined: 10 Dec 2015, 15:50

SmartFox Task Scheduler

Postby ekrem5353 » 31 Mar 2016, 15:37

Hi,
I am trying to use Task scheduler inside of zone extension. MessageManager class has a run method. it goes to db gets new messages and updates todays messages at Zone Extensions instance variable which keeps messages. I use task scheduler at game room extensions without any problem so far but(I use ). I am testing it on my computer after a while it stops. it should be running like forever. I initialize it at init method.

sfs.getTaskScheduler().scheduleAtFixedRate(messageManager,5,10, TimeUnit.SECONDS); ( Note: It should work every 5 minutes I made it seconds to see if its going to stop )

Thanks.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox Task Scheduler

Postby Lapo » 01 Apr 2016, 07:37

Hi,
make sure you're catching exceptions as explained in the docs.
http://docs2x.smartfoxserver.com/Gettin ... wtos#item7

If an exception is raised and you don't catch it the task will stop.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Alexwek and 50 guests