Manav Rathi 1 年之前
父節點
當前提交
0109602168
共有 1 個文件被更改,包括 3 次插入25 次删除
  1. 3 25
      web/apps/photos/src/services/machineLearning/machineLearningService.ts

+ 3 - 25
web/apps/photos/src/services/machineLearning/machineLearningService.ts

@@ -54,28 +54,7 @@ export async function updateMLSearchConfig(newConfig: MLSearchConfig) {
     return mlIDbStorage.putConfig(ML_SEARCH_CONFIG_NAME, newConfig);
     return mlIDbStorage.putConfig(ML_SEARCH_CONFIG_NAME, newConfig);
 }
 }
 
 
-export interface MLSyncContext {
-    token: string;
-    userID: number;
-
-    localFilesMap: Map<number, EnteFile>;
-    outOfSyncFiles: EnteFile[];
-    nSyncedFiles: number;
-    nSyncedFaces: number;
-    allSyncedFacesMap?: Map<number, Array<Face>>;
-
-    error?: Error;
-
-    // oldMLLibraryData: MLLibraryData;
-    mlLibraryData: MLLibraryData;
-
-    syncQueue: PQueue;
-
-    getEnteWorker(id: number): Promise<any>;
-    dispose(): Promise<void>;
-}
-
-export class LocalMLSyncContext implements MLSyncContext {
+class MLSyncContext {
     public token: string;
     public token: string;
     public userID: number;
     public userID: number;
 
 
@@ -83,7 +62,6 @@ export class LocalMLSyncContext implements MLSyncContext {
     public outOfSyncFiles: EnteFile[];
     public outOfSyncFiles: EnteFile[];
     public nSyncedFiles: number;
     public nSyncedFiles: number;
     public nSyncedFaces: number;
     public nSyncedFaces: number;
-    public allSyncedFacesMap?: Map<number, Array<Face>>;
 
 
     public error?: Error;
     public error?: Error;
 
 
@@ -297,7 +275,7 @@ class MachineLearningService {
 
 
             // TODO-ML(MR): Keep as promise for now.
             // TODO-ML(MR): Keep as promise for now.
             this.syncContext = new Promise((resolve) => {
             this.syncContext = new Promise((resolve) => {
-                resolve(new LocalMLSyncContext(token, userID));
+                resolve(new MLSyncContext(token, userID));
             });
             });
         } else {
         } else {
             log.info("reusing existing syncContext");
             log.info("reusing existing syncContext");
@@ -311,7 +289,7 @@ class MachineLearningService {
             log.info("Creating localSyncContext");
             log.info("Creating localSyncContext");
             // TODO-ML(MR):
             // TODO-ML(MR):
             this.localSyncContext = new Promise((resolve) => {
             this.localSyncContext = new Promise((resolve) => {
-                resolve(new LocalMLSyncContext(token, userID));
+                resolve(new MLSyncContext(token, userID));
             });
             });
         } else {
         } else {
             log.info("reusing existing localSyncContext");
             log.info("reusing existing localSyncContext");