π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Pause image embedding computation when user is interacting with the app
vishnukvmd177464c203cb
diff --git a/lib/services/semantic_search/semantic_search_service.dart b/lib/services/semantic_search/semantic_search_service.dartindex 62d20da175..8699b0e4ec 100644--- a/lib/services/semantic_search/semantic_search_service.dart+++ b/lib/services/semantic_search/semantic_search_service.dart@@ -49,12 +49,21 @@ class SemanticSearchService {Future<List<EnteFile>>? _ongoingRequest;List<Embedding> _cachedEmbeddings = <Embedding>[];PendingQuery? _nextQuery;+ Completer<void> _userInteraction = Completer<void>();get hasInitialized => _hasInitialized;- void resumeIndexing() {}+ void resumeIndexing() {+ _logger.info("Resuming indexing");+ _userInteraction.complete();+ }- void pauseIndexing() {}+ void pauseIndexing() {+ if (_userInteraction.isCompleted) {+ _logger.info("Pausing indexing");+ _userInteraction = Completer<void>();+ }+ }Future<void> init({bool shouldSyncImmediately = false}) async {if (!LocalSettings.instance.hasEnabledMagicSearch()) {@@ -283,6 +292,10 @@ class SemanticSearchService {if (!_frameworkInitialization.isCompleted) {return;}+ if (!_userInteraction.isCompleted) {+ _logger.info("Waiting for user interactions to stop...");+ await _userInteraction.future;+ }try {final thumbnail = await getThumbnailForUploadedFile(file);if (thumbnail == null) {