Skip to content

Commit

Permalink
moved save call to the synchronous part. Still have to figure out how…
Browse files Browse the repository at this point in the history
… to deal with #81.....
  • Loading branch information
Szum123321 committed Sep 9, 2023
1 parent 354c83f commit 1eb4073
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22

#Fabric api
fabric_version=0.83.0+1.20
fabric_version=0.88.1+1.20.1

#Cloth Config
cloth_version=11.0.98
cloth_version=11.1.106

#ModMenu
modmenu_version=7.0.0-beta.2
modmenu_version=7.2.2

databreaker_version=0.2.10

#Hash of commit form which parallel gzip will be build
pgzip_commit_hash=af5f5c297e735f3f2df7aa4eb0e19a5810b8aff6

# Mod Properties
mod_version = 3.1.0
mod_version = 3.1.1
maven_group = net.szum123321
archives_base_name = textile_backup
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,15 @@ public void announce() {
}
@Override
public Void call() throws Exception {
if (save) { //save the world
log.sendInfoAL(this, "Saving server...");
server.saveAll(true, true, false);
}

Path outFile = Utilities.getBackupRootPath(Utilities.getLevelName(server)).resolve(getFileName());

log.trace("Outfile is: {}", outFile);

try {
//I think I should synchronise these two next calls...
Utilities.disableWorldSaving(server);
Globals.INSTANCE.disableWatchdog = true;

Globals.INSTANCE.disableWatchdog = true;
Globals.INSTANCE.updateTMPFSFlag(server);

log.sendInfoAL(this, "Starting backup");
Expand Down Expand Up @@ -225,6 +220,14 @@ public ExecutableBackup build() {
ExecutableBackup v = new ExecutableBackup(server, commandSource, initiator, save, cleanup, comment, LocalDateTime.now());

if(announce) v.announce();

if (save) { //save the world
// We need to flush everything as next thing we'll be copying all the files.
// this is mostly the reason for #81 - minecraft doesn't flush during scheduled saves.
log.sendInfoAL(this.commandSource, "Saving server...");
server.saveAll(true, true, false);
}

return v;
}
}
Expand Down

0 comments on commit 1eb4073

Please sign in to comment.