Weird issue with extension background tasks
Posted: 15 Sep 2020, 19:32
Hi,
So I have a working java extension. I had added a background "monitoring" thread to periodically check "state" and perform some actions.
It was working fine for a while and then stopped working. I don't think I changed anything with the code, so could have been an issue with the latest patch?
Code:
Any assistance would be greatly appreciated. Thanks
So I have a working java extension. I had added a background "monitoring" thread to periodically check "state" and perform some actions.
It was working fine for a while and then stopped working. I don't think I changed anything with the code, so could have been an issue with the latest patch?
Code:
Code: Select all
@Instantiation(InstantiationMode.SINGLE_INSTANCE)
public class MyExtension extends BaseClientRequestHandler {
private class TaskRunner implements Runnable {
public TaskRunner(String rname) {
..
}
public void run() {
trace("THIS CODE IS NEVER CALLED");
}
}
public MyExtension () {
SmartFoxServer sfs = SmartFoxServer.getInstance();
taskHandle = sfs.getTaskScheduler().scheduleAtFixedRate(new TaskRunner(""), 0, 1, TimeUnit.SECONDS);
}
...
}
Any assistance would be greatly appreciated. Thanks