Problem with tasksceduler in zone extesion

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

HamzehShabani
Posts: 5
Joined: 06 Sep 2019, 15:06

Problem with tasksceduler in zone extesion

Postby HamzehShabani » 06 Sep 2019, 15:27

Hi, i wrote a code for checking something in period of time, in my extension and use of that for my zone extension.

Code: Select all

SendStats = sfs.getTaskScheduler().scheduleAtFixedRate(new SendStats(), 0, 10, TimeUnit.SECONDS);

i call this task scheduler in init() method, bud after some minutes (10-30) dosen't work anymore!!!

i think my code is true and i'm confused for this problem, i donet know what i have to do, please help me if you can, thanks.
User avatar
Lapo
Site Admin
Posts: 21282
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem with tasksceduler in zone extesion

Postby Lapo » 06 Sep 2019, 15:48

Hi,
you have to make sure to catch all exceptions inside your run() method otherwise an error in your task could stop it from running. Check this short article for more details:
https://smartfoxserver.com/blog/how-to- ... extension/

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
HamzehShabani
Posts: 5
Joined: 06 Sep 2019, 15:06

Re: Problem with tasksceduler in zone extesion

Postby HamzehShabani » 06 Sep 2019, 16:10

Lapo wrote:Hi,
you have to make sure to catch all exceptions inside your run() method otherwise an error in your task could stop it from running. Check this short article for more details:
https://smartfoxserver.com/blog/how-to- ... extension/

Hope it helps

ok, i'm going to check catching all exceptions and send you feedback, thanks for your help
HamzehShabani
Posts: 5
Joined: 06 Sep 2019, 15:06

Re: Problem with tasksceduler in zone extesion

Postby HamzehShabani » 13 Sep 2019, 10:12

Lapo wrote:Hi,
you have to make sure to catch all exceptions inside your run() method otherwise an error in your task could stop it from running. Check this short article for more details:
https://smartfoxserver.com/blog/how-to- ... extension/

Hope it helps


catch exceptions solved my problems, thank you.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 7 guests