浏览代码

[mob] move fetching related code inside fetching block

laurenspriem 1 年之前
父节点
当前提交
d65264e8e8
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      mobile/lib/services/machine_learning/face_ml/face_ml_service.dart

+ 6 - 5
mobile/lib/services/machine_learning/face_ml/face_ml_service.dart

@@ -557,13 +557,14 @@ class FaceMlService {
       outerLoop:
       for (final chunk in chunks) {
         final futures = <Future<bool>>[];
-        final List<int> fileIds = [];
-        // Try to find embeddings on the remote server
-        for (final f in chunk) {
-          fileIds.add(f.uploadedFileID!);
-        }
+
         if (LocalSettings.instance.remoteFetchEnabled) {
           try {
+            final List<int> fileIds = [];
+            // Try to find embeddings on the remote server
+            for (final f in chunk) {
+              fileIds.add(f.uploadedFileID!);
+            }
             final EnteWatch? w = kDebugMode ? EnteWatch("face_em_fetch") : null;
             w?.start();
             w?.log('starting remote fetch for ${fileIds.length} files');