[O] Use timeout for updateCache
This commit is contained in:
@@ -96,11 +96,16 @@ public class SeedServerCache extends Behavior
|
|||||||
new Thread(this::loadChunks).start();
|
new Thread(this::loadChunks).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// Update cache
|
|
||||||
if (cacheLocation == null)
|
|
||||||
{
|
{
|
||||||
new Thread(this::updateCache).start();
|
// Update cache every 5 seconds (5 * 20 = 100 ticks)
|
||||||
|
ticks ++;
|
||||||
|
|
||||||
|
if (ticks > 100)
|
||||||
|
{
|
||||||
|
ticks = 0;
|
||||||
|
new Thread(this::updateCache).start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user