forked from SteamWar/SteamWar
Delete CRIU checkpoint on /bau delete
/bau delete only removed the world folder. The checkpoint of the build server stayed in place, so the next start restored the old JVM state against a freshly copied world (superflat world, plugins inactive). Extract ServerStarter#checkpointDir and delete the checkpoint together with the world. Fixes #438
This commit is contained in:
@@ -303,7 +303,7 @@ public class ServerStarter {
|
||||
worldSetup.run();
|
||||
arguments.put("logPath", worldName);
|
||||
|
||||
File checkpointDir = new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + directory.getName() + "/" + worldName);
|
||||
File checkpointDir = checkpointDir(directory, worldName);
|
||||
if (checkpoint) {
|
||||
arguments.put("checkpoint", checkpointDir.getPath());
|
||||
}
|
||||
@@ -326,6 +326,10 @@ public class ServerStarter {
|
||||
}).schedule();
|
||||
}
|
||||
|
||||
public static File checkpointDir(File serverDirectory, String worldName) {
|
||||
return new File("/tmp/" + System.getProperty("user.name") + ".checkpoints/" + serverDirectory.getName() + "/" + worldName);
|
||||
}
|
||||
|
||||
private void regularStart(String serverName, int port) {
|
||||
postStart(constructor.construct(serverName, port, node.startServer(
|
||||
version, directory, worldDir, worldName, port, arguments.entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).toArray(String[]::new)
|
||||
|
||||
@@ -261,6 +261,7 @@ public class BauCommand extends SWCommand {
|
||||
}
|
||||
|
||||
SubserverSystem.deleteFolder(VelocityCore.local, world);
|
||||
SubserverSystem.deleteFolder(VelocityCore.local, ServerStarter.checkpointDir(version.getServerDirectory("Bau"), String.valueOf(sender.user().getId())).getPath());
|
||||
sender.system("BAU_DELETE_DELETED");
|
||||
}).schedule();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user