From b100f1d4bfe27c646bca14c761e48b320bd052c8 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Mon, 27 May 2024 11:28:05 +0530 Subject: [PATCH] [mob][photos] Catch and stopwatch on faces db creation --- mobile/lib/face/db.dart | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/mobile/lib/face/db.dart b/mobile/lib/face/db.dart index 3ad90915d..388b30b1e 100644 --- a/mobile/lib/face/db.dart +++ b/mobile/lib/face/db.dart @@ -55,12 +55,21 @@ class FaceMLDataDB { } Future _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.