mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-01 15:36:45 +00:00
fix deleting mantle temp files before they are fully written
This commit is contained in:
parent
f32f73e65a
commit
01b62c13b6
@ -369,11 +369,10 @@ public class Mantle {
|
|||||||
*/
|
*/
|
||||||
public synchronized void close() {
|
public synchronized void close() {
|
||||||
Iris.debug("Closing The Mantle " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
Iris.debug("Closing The Mantle " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
||||||
if (closed.get()) {
|
if (closed.getAndSet(true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
closed.set(true);
|
|
||||||
hyperLock.disable();
|
hyperLock.disable();
|
||||||
BurstExecutor b = ioBurst.burst(toUnload.size());
|
BurstExecutor b = ioBurst.burst(toUnload.size());
|
||||||
loadedRegions.forEach((i, plate) -> b.queue(() -> {
|
loadedRegions.forEach((i, plate) -> b.queue(() -> {
|
||||||
@ -383,11 +382,11 @@ public class Mantle {
|
|||||||
oldFileForRegion(dataFolder, i).delete();
|
oldFileForRegion(dataFolder, i).delete();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Failed to write Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
|
Iris.error("Failed to write Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
|
||||||
|
Iris.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
loadedRegions.clear();
|
loadedRegions.clear();
|
||||||
IO.delete(new File(dataFolder, ".tmp"));
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
b.complete();
|
b.complete();
|
||||||
@ -395,6 +394,7 @@ public class Mantle {
|
|||||||
Iris.reportError(e);
|
Iris.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IO.delete(new File(dataFolder, ".tmp"));
|
||||||
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user