Attempt to fix a null error
This commit is contained in:
parent
aba2f101dc
commit
bba75793dd
1 changed files with 7 additions and 10 deletions
|
@ -21,6 +21,12 @@ public class DelayedExecutorService {
|
|||
static{
|
||||
inst=new DelayedExecutorService();
|
||||
repeater = new ScheduledThreadPoolExecutor(16);
|
||||
repeater.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DelayedExecutorService.getInstance().onTick();
|
||||
}
|
||||
}, 1L, 1L, TimeUnit.SECONDS);
|
||||
}
|
||||
private DelayedExecutorService(){}
|
||||
|
||||
|
@ -45,14 +51,9 @@ public class DelayedExecutorService {
|
|||
/**
|
||||
* This function is designed to set back up the executor if it was previously stopped and restarted.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setup()
|
||||
{
|
||||
repeater.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DelayedExecutorService.getInstance().onTick();
|
||||
}
|
||||
}, 1L, 1L, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,10 +144,6 @@ public class DelayedExecutorService {
|
|||
|
||||
public void onTick()
|
||||
{
|
||||
if(!isRunning())
|
||||
{
|
||||
DelayedExecutorService.stopRepeatingThread();
|
||||
}
|
||||
/*Iterator<DelayedExecution> it = EXECUTORS.iterator();
|
||||
try{
|
||||
|
||||
|
|
Loading…
Reference in a new issue