Merge pull request #493 from NBA2K1/main

Release file lock by closing InputStream
This commit is contained in:
Moustapha Kodjo Amadou 2025-06-24 11:58:47 +01:00 committed by GitHub
commit 53c82d80dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,6 +62,8 @@ void doRestore(Ref ref, {required String path, required BuildContext context}) {
}
} catch (e, s) {
botToast('$e\n$s');
} finally {
inputStream.close();
}
}
@ -379,9 +381,9 @@ void restoreKotatsuBackup(Ref ref, Archive archive) {
@riverpod
void restoreTachiBkBackup(Ref ref, String path, BackupType bkType) {
final content = GZipDecoder().decodeBytes(
InputFileStream(path).toUint8List(),
);
final inputStream = InputFileStream(path);
final content = GZipDecoder().decodeBytes(inputStream.toUint8List());
inputStream.close();
final backup = BackupMihon.fromBuffer(content);
List<Category> cats = [];
isar.writeTxnSync(() {