Make BackupScheduler actually work + typo

This commit is contained in:
szymon 2020-07-14 21:36:13 +02:00
parent 888d56c3bb
commit 5dd25ce192
3 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ public class TextileBackup implements ModInitializer {
public static ConfigHandler config;
public static final BackupScheduler scheduler = new BackupScheduler();
public static final ExecutorService executorSerivece = Executors.newSingleThreadExecutor();
public static final ExecutorService executorService = Executors.newSingleThreadExecutor();
@Override
public void onInitialize() {

View File

@ -35,7 +35,7 @@ public class StartBackupCommand {
}
private static int executeWithComment(CommandContext<ServerCommandSource> source) {
TextileBackup.executorSerivece.submit(
TextileBackup.executorService.submit(
BackupHelper.create(
source.getSource().getMinecraftServer(),
source.getSource(),
@ -48,7 +48,7 @@ public class StartBackupCommand {
}
private static int execute(ServerCommandSource source){
TextileBackup.executorSerivece.submit(
TextileBackup.executorService.submit(
BackupHelper.create(
source.getMinecraftServer(),
source,

View File

@ -22,8 +22,8 @@ public class BackupScheduler {
if(TextileBackup.config.doBackupsOnEmptyServer || server.getPlayerManager().getCurrentPlayerCount() > 0) {
if(scheduled) {
if(nextBackup >= now) {
TextileBackup.executorSerivece.submit(BackupHelper.create(server, null, true, null));
if(nextBackup <= now) {
TextileBackup.executorService.submit(BackupHelper.create(server, null, true, null));
nextBackup = now + TextileBackup.config.backupInterval;
}
@ -32,8 +32,8 @@ public class BackupScheduler {
scheduled = true;
}
} else if(!TextileBackup.config.doBackupsOnEmptyServer && server.getPlayerManager().getCurrentPlayerCount() == 0) {
if(scheduled && nextBackup >= now) {
TextileBackup.executorSerivece.submit(BackupHelper.create(server, null, true, null));
if(scheduled && nextBackup <= now) {
TextileBackup.executorService.submit(BackupHelper.create(server, null, true, null));
scheduled = false;
}