put timeout back

This commit is contained in:
wagyourtail
2021-10-09 14:55:20 -06:00
parent d22a52976b
commit bd5ffe8f31

View File

@@ -82,9 +82,9 @@ public final class AStarPathFinder extends AbstractNodeCostSearch {
while (!openSet.isEmpty() && numEmptyChunk < pathingMaxChunkBorderFetch && !cancelRequested) {
if ((numNodes & (timeCheckInterval - 1)) == 0) { // only call this once every 64 nodes (about half a millisecond)
long now = System.currentTimeMillis(); // since nanoTime is slow on windows (takes many microseconds)
// if (now - failureTimeoutTime >= 0 || (!failing && now - primaryTimeoutTime >= 0)) {
// break;
// }
if (now - failureTimeoutTime >= 0 || (!failing && now - primaryTimeoutTime >= 0)) {
break;
}
}
if (slowPath) {
try {