mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Validate backup during creation
This commit is contained in:
parent
f8b2c79aef
commit
4f56071786
1 changed files with 6 additions and 1 deletions
|
@ -85,7 +85,12 @@ class FullBackupManager(context: Context) : AbstractBackupManager(context) {
|
||||||
|
|
||||||
val byteArray = parser.encodeToByteArray(BackupSerializer, backup!!)
|
val byteArray = parser.encodeToByteArray(BackupSerializer, backup!!)
|
||||||
file.openOutputStream().sink().gzip().buffer().use { it.write(byteArray) }
|
file.openOutputStream().sink().gzip().buffer().use { it.write(byteArray) }
|
||||||
return file.uri.toString()
|
val fileUri = file.uri
|
||||||
|
|
||||||
|
// Validate it to make sure it works
|
||||||
|
FullBackupRestoreValidator().validate(context, fileUri)
|
||||||
|
|
||||||
|
return fileUri.toString()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
logcat(LogPriority.ERROR, e)
|
logcat(LogPriority.ERROR, e)
|
||||||
throw e
|
throw e
|
||||||
|
|
Loading…
Reference in a new issue