mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
Setting eagerError may cause the transaction to end before all future returns
This commit is contained in:
parent
2df27502f1
commit
84264dad20
1 changed files with 26 additions and 30 deletions
|
@ -264,8 +264,7 @@ class FileSqliteCacheUpdater {
|
|||
.map((r) => MapEntry(r.read(db.files.fileId)!, r.read(db.files.rowId)!))
|
||||
.get());
|
||||
|
||||
await Future.wait(
|
||||
sqlFiles.map((f) async {
|
||||
await Future.wait(sqlFiles.map((f) async {
|
||||
var rowId = fileRowIdMap[f.file.fileId.value];
|
||||
if (rowId != null) {
|
||||
// shared file that exists in other accounts
|
||||
|
@ -275,9 +274,8 @@ class FileSqliteCacheUpdater {
|
|||
);
|
||||
rowId = dbFile.rowId;
|
||||
}
|
||||
final dbAccountFile = await db
|
||||
.into(db.accountFiles)
|
||||
.insertReturning(f.accountFile.copyWith(
|
||||
final dbAccountFile =
|
||||
await db.into(db.accountFiles).insertReturning(f.accountFile.copyWith(
|
||||
account: sql.Value(dbAccount.rowId),
|
||||
file: sql.Value(rowId),
|
||||
));
|
||||
|
@ -291,9 +289,7 @@ class FileSqliteCacheUpdater {
|
|||
.insert(f.trash!.copyWith(file: sql.Value(rowId)));
|
||||
}
|
||||
_onRowCached(rowId, f, dir);
|
||||
}),
|
||||
eagerError: true,
|
||||
);
|
||||
}));
|
||||
}
|
||||
|
||||
void _onRowCached(int rowId, sql.CompleteFileCompanion dbFile, File? dir) {
|
||||
|
|
Loading…
Reference in a new issue