Skip to content

Commit

Permalink
Use "backupInterval" to disable auto backups (#608)
Browse files Browse the repository at this point in the history
Gets rid of unnecessary setting
  • Loading branch information
schroda authored Jul 22, 2023
1 parent d4f9b0b commit 2a83f29
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ object ProtoBackupExport : ProtoBackupBase() {
fun scheduleAutomatedBackupTask() {
HAScheduler.deschedule(backupSchedulerJobId)

if (!serverConfig.automatedBackups) {
val areAutomatedBackupsDisabled = serverConfig.backupInterval == 0
if (areAutomatedBackupsDisabled) {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ServerConfig(getConfig: () -> Config, moduleName: String = MODULE_NAME) :
var backupPath: String by overridableConfig
var backupTime: String by overridableConfig
var backupInterval: Int by overridableConfig
var automatedBackups: Boolean by overridableConfig
var backupTTL: Int by overridableConfig

companion object {
Expand Down
3 changes: 1 addition & 2 deletions server/src/main/resources/server-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ server.systemTrayEnabled = true
# backup
server.backupPath = ""
server.backupTime = "00:00" # range: hour: 0-23, minute: 0-59 - default: "00:00" - time of day at which the automated backup should be triggered
server.backupInterval = 1 # time in days - range: 1 <= n < ∞ - default: 1 day - interval in which the server will automatically create a backup
server.automatedBackups = true
server.backupInterval = 1 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 1 day - interval in which the server will automatically create a backup
server.backupTTL = 14 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 14 days - how long backup files will be kept before they will get deleted
1 change: 0 additions & 1 deletion server/src/test/resources/server-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ server.webUIUpdateCheckInterval = 24
server.backupPath = ""
server.backupTime = "00:00"
server.backupInterval = 1
server.automatedBackups = true
server.backupTTL = 14

0 comments on commit 2a83f29

Please sign in to comment.