Hi,
I have a question about the task scheduler (sfs.getTaskScheduler()). I have noticed that if I have some scheduled tasks running, and frequently have extensions reload (to smoothly update the software without requiring a restart), or during development, that sometimes some of the old tasks are still running in the background, and this adds up over time so I have a situation where I can see schedules are running multiple times.
Is there a way to safely shut down and end a task (in the old "instance") when the extension is reloaded during an update situation ?
Many thanks for your help!
Old Taskscheduler still runs after auto reloading extensions
Re: Old Taskscheduler still runs after auto reloading extensions
Hi,
are we talking about SFS2X? I ask because this was posted under SFS 1.x...
Thanks
are we talking about SFS2X? I ask because this was posted under SFS 1.x...
Thanks
Re: Old Taskscheduler still runs after auto reloading extensions
Hi, yes my apologies. Are you able to move this thread?
Re: Old Taskscheduler still runs after auto reloading extensions
marsoups wrote:Hi, yes my apologies. Are you able to move this thread?
Sure, done
Back to your question, you just need to keep a reference to every task that was added to the Scheduler, so that you can cancel them in your Extension's destroy() method.
Take a look here for an example:
https://smartfoxserver.com/blog/how-to- ... extension/
Hope it helps
Who is online
Users browsing this forum: No registered users and 103 guests