Call the backup cleaner method
This commit is contained in:
parent
264300ead6
commit
f2d1acd24a
@ -104,6 +104,12 @@ public abstract class CompressProcess implements Comparable<CompressProcess>, Ru
|
|||||||
backupManager.persist.updateDirtyStatusAfterCompress(type, name);
|
backupManager.persist.updateDirtyStatusAfterCompress(type, name);
|
||||||
|
|
||||||
displayDirtynessStatus();
|
displayDirtynessStatus();
|
||||||
|
|
||||||
|
try {
|
||||||
|
type.backupCleaner(backupManager.config).cleanupArchives(targetDir);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.severe(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (final Exception e) {
|
catch (final Exception e) {
|
||||||
Log.severe("[Backup] Failed: " + sourceDir + " -> " + target, e);
|
Log.severe("[Backup] Failed: " + sourceDir + " -> " + target, e);
|
||||||
|
@ -15,5 +15,12 @@ public enum Type {
|
|||||||
case WORKDIR -> cfg.workdirBackupEnabled;
|
case WORKDIR -> cfg.workdirBackupEnabled;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BackupCleaner backupCleaner(BackupConfig cfg) {
|
||||||
|
return switch (this) {
|
||||||
|
case WORLDS -> cfg.worldBackupCleaner;
|
||||||
|
case WORKDIR -> cfg.workdirBackupCleaner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user