Skip to content

Commit

Permalink
cleanCache()
Browse files Browse the repository at this point in the history
  • Loading branch information
lhns committed Aug 14, 2023
1 parent ea4a262 commit 2242612
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/src/main/java/de/lolhens/resticui/restic/Restic.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ class Restic(
}
}

fun cleanCache(): CompletableFuture<Pair<List<String>, List<String>>> =
restic(listOf("cache", "--cleanup", "--max-age", "0"))

fun version(): CompletableFuture<String> =
restic(listOf("version")).thenApply { (out, _) -> out[0] }
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SettingsFragment : Fragment() {
}

binding.buttonCleanup.setOnClickListener {
backupManager.restic.restic(listOf("cache", "--cleanup", "--max-age", "0"))
backupManager.restic.cleanCache()
.handle { message, throwable ->
if (throwable != null) {
throwable.printStackTrace()
Expand Down

0 comments on commit 2242612

Please sign in to comment.