mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-10-29 19:59:22 +00:00
Communicate to user if db backup files could not be deleted (#7872)
This commit is contained in:
parent
9a2b3a4a92
commit
e32dbaeb31
@ -90,8 +90,15 @@ public class AutomaticDatabaseExportWorker extends Worker {
|
||||
}
|
||||
}
|
||||
Collections.sort(files, (o1, o2) -> Long.compare(o2.lastModified(), o1.lastModified()));
|
||||
boolean hasDeletionFailed = false;
|
||||
for (int i = 5; i < files.size(); i++) {
|
||||
files.get(i).delete();
|
||||
boolean isDeleted = files.get(i).delete();
|
||||
if (!hasDeletionFailed && !isDeleted) {
|
||||
hasDeletionFailed = true;
|
||||
}
|
||||
}
|
||||
if (hasDeletionFailed) {
|
||||
throw new IOException("Unable to delete some database backup files");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user