Store last delay, so if a search takes a long time, it does not bog the server down.

This commit is contained in:
zontreck 2023-12-18 18:59:52 -07:00
parent 949ec511b7
commit 1c866e304e
3 changed files with 11 additions and 3 deletions

View file

@ -70,8 +70,9 @@ public class RandomPositionLocator extends Task
}else {
// Schedule the task to execute
//run();
RandomPositionLocator next = new RandomPositionLocator(contain);
DelayedExecutorService.getInstance().schedule(next, 1);
RandomPositionLocator next = new RandomPositionLocator(contain.withThreadDelay(contain.lastThreadDelay+1));
DelayedExecutorService.getInstance().schedule(next, contain.lastThreadDelay+1);
AriasEssentials.LOGGER.info("Giving up current RTP search. Scheduling another search in 1 second");
}
}