mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-25 21:40:05 +00:00
Stop a failed pregen instead of leaving it running
An exception on the pregen thread ended the thread without shutting the job down, so it kept reporting 0 chunks per second forever and blocked starting another pregen. A failure is now logged and the job is closed. Model used: Claude Opus 5.5
This commit is contained in:
1 parent
6a85cb53a9
commit
18e0834db8
1 file changed
+20
-6
@@ -167,6 +167,26 @@ public class IrisPregenerator {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
boolean completed = false;
|
||||
try {
|
||||
generateAll();
|
||||
completed = true;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Pregen failed and is stopping: %s", e);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
if (benchmarking == null) {
|
||||
Iris.info(C.IRIS + "Pregen stopped.");
|
||||
} else if (completed) {
|
||||
benchmarking.finishedBenchmark(chunksPerSecondHistory);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateAll() {
|
||||
init();
|
||||
ticker.start();
|
||||
checkRegions();
|
||||
@@ -174,12 +194,6 @@ public class IrisPregenerator {
|
||||
task.iterateRegions((x, z) -> visitRegion(x, z, true));
|
||||
task.iterateRegions((x, z) -> visitRegion(x, z, false));
|
||||
Iris.info("Pregen took " + Form.duration((long) p.getMilliseconds()));
|
||||
shutdown();
|
||||
if (benchmarking == null) {
|
||||
Iris.info(C.IRIS + "Pregen stopped.");
|
||||
} else {
|
||||
benchmarking.finishedBenchmark(chunksPerSecondHistory);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkRegions() {
|
||||
|
||||
Reference in new issue
Block a user