From 7800b7db32de6331df2e8b4c1fe955d78f4625d9 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Thu, 23 May 2024 14:35:15 +0530 Subject: [PATCH] [mob][photos] Regularly check for wifi --- .../machine_learning/face_ml/face_ml_service.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart index b9ccc510e..b017999fa 100644 --- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart +++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart @@ -509,13 +509,13 @@ class FaceMlService { } } } - if (!await canUseHighBandwidth()) { - _logger - .info('stopping indexing because user is not connected to wifi'); - continue; - } final smallerChunks = chunk.chunks(_fileDownloadLimit); for (final smallestChunk in smallerChunks) { + if (!await canUseHighBandwidth()) { + _logger.info( + 'stopping indexing because user is not connected to wifi',); + break outerLoop; + } for (final enteFile in smallestChunk) { if (_shouldPauseIndexingAndClustering) { _logger.info("indexAllImages() was paused, stopping");