Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add indexing debug cooldown

laurenspriemfc8122b18eb7
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 c8a09bbff7..8ed8331781 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
@@ -511,6 +511,14 @@ class FaceMlService {
(previousValue, element) => previousValue + (element ? 1 : 0),
);
fileAnalyzedCount += sumFutures;
+
+ // TODO: remove this cooldown later. Cooldown of one minute every 400 images
+ if (fileAnalyzedCount > 400 && fileAnalyzedCount % 400 < kParallelism) {
+ _logger.info(
+ "indexAllImages() analyzed $fileAnalyzedCount images, cooldown for 1 minute",
+ );
+ await Future.delayed(const Duration(minutes: 1));
+ }
}
stopwatch.stop();