Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Catch and stopwatch on faces db creation

laurenspriemb100f1d4bfe2
diff --git a/mobile/lib/face/db.dart b/mobile/lib/face/db.dart
index 3ad90915d4..388b30b1e3 100644
--- a/mobile/lib/face/db.dart
+++ b/mobile/lib/face/db.dart
@@ -55,12 +55,21 @@ class FaceMLDataDB {
}
Future<void> _onCreate(SqliteDatabase asyncDBConnection) async {
- await asyncDBConnection.execute(createFacesTable);
- await asyncDBConnection.execute(createFaceClustersTable);
- await asyncDBConnection.execute(createClusterPersonTable);
- await asyncDBConnection.execute(createClusterSummaryTable);
- await asyncDBConnection.execute(createNotPersonFeedbackTable);
- await asyncDBConnection.execute(fcClusterIDIndex);
+ try {
+ final startTime = DateTime.now();
+ await asyncDBConnection.execute(createFacesTable);
+ await asyncDBConnection.execute(createFaceClustersTable);
+ await asyncDBConnection.execute(createClusterPersonTable);
+ await asyncDBConnection.execute(createClusterSummaryTable);
+ await asyncDBConnection.execute(createNotPersonFeedbackTable);
+ await asyncDBConnection.execute(fcClusterIDIndex);
+ _logger.info(
+ 'FaceMLDataDB tables created in ${DateTime.now().difference(startTime).inMilliseconds}ms',
+ );
+ } catch (e, s) {
+ _logger.severe("Error creating FaceMLDataDB tables", e, s);
+ rethrow;
+ }
}
// bulkInsertFaces inserts the faces in the database in batches of 1000.