Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] Open the vector index before reading its fill state

laurenspriem5f29b652697b
diff --git a/mobile/apps/photos/lib/db/ml/rust_db.dart b/mobile/apps/photos/lib/db/ml/rust_db.dart
index af82f9f521..22ae2c7e48 100644
--- a/mobile/apps/photos/lib/db/ml/rust_db.dart
+++ b/mobile/apps/photos/lib/db/ml/rust_db.dart
@@ -63,8 +63,14 @@ class RustMLDataDB implements IMLDataDB<int> {
}
}
- Future<rust.FillState> fillState(rust.Index index) async =>
- (await store).fillState(index: index);
+ Future<rust.FillState> fillState(rust.Index index) async {
+ final db = await store;
+ await _openIndex(db, index);
+ return db.fillState(index: index);
+ }
+
+ Future<void> _openIndex(rust.MlStore db, rust.Index index) =>
+ db.stats(index: index);
Future<void> releaseVectorIndexes() async {
if (_dbFuture == null) return;