Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Store existing results first before yeilding for indexing

Neeraj Gupta4fd3a269b08f
diff --git a/mobile/lib/utils/ml_util.dart b/mobile/lib/utils/ml_util.dart
index 06ba53c1d6..9234857dca 100644
--- a/mobile/lib/utils/ml_util.dart
+++ b/mobile/lib/utils/ml_util.dart
@@ -235,6 +235,9 @@ Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions(
pendingIndex[fileMl.fileID] = existingInstruction;
}
}
+
+ await mlDataDB.bulkInsertFaces(faces);
+ await mlDataDB.putClip(clipEmbeddings);
for (final fileID in pendingIndex.keys) {
final instruction = pendingIndex[fileID]!;
if (instruction.pendingML) {
@@ -246,8 +249,6 @@ Stream<List<FileMLInstruction>> fetchEmbeddingsAndInstructions(
}
}
}
- await mlDataDB.bulkInsertFaces(faces);
- await mlDataDB.putClip(clipEmbeddings);
}
// Yield any remaining instructions
if (batchToYield.isNotEmpty) {