Page 1 of 1

Problem with tasksceduler in zone extesion

Posted: 06 Sep 2019, 15:27
by HamzehShabani
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.

Re: Problem with tasksceduler in zone extesion

Posted: 06 Sep 2019, 15:48
by Lapo
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

Re: Problem with tasksceduler in zone extesion

Posted: 06 Sep 2019, 16:10
by HamzehShabani
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

Re: Problem with tasksceduler in zone extesion

Posted: 13 Sep 2019, 10:12
by HamzehShabani
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.