refactor: refactoring of code

This commit is contained in:
2024-02-20 07:55:55 +01:00
parent 641ac941a0
commit 4e16823072
2 changed files with 5 additions and 12 deletions

View File

@@ -154,11 +154,10 @@ func BackupDatabase(disableCompression bool, prune bool, keepLast int) {
}
utils.Done("Database has been backed up")
//Delete old backup
if prune {
deleteOldBackup(keepLast)
}
}
//Delete old backup
if prune {
deleteOldBackup(keepLast)
}
historyFile, err := os.OpenFile(fmt.Sprintf("%s/history.txt", storagePath), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
@@ -191,7 +190,7 @@ func deleteOldBackup(keepLast int) {
if err != nil {
utils.Fatal("Error:", err)
} else {
utils.Done("File", filePath, "deleted successfully")
utils.Done("File ", filePath, " deleted successfully")
}
return err
}