Skip to content

armgit / ente

Public Imported from GitHub
0

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

Read

Manav Rathi532a9f64ffb8
diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.ts
index 5123fc33cc..bcc448a4ea 100644
--- a/web/packages/new/photos/services/ml/worker.ts
+++ b/web/packages/new/photos/services/ml/worker.ts
@@ -11,6 +11,7 @@ import { wait } from "@/utils/promise";
import { fileLogID } from "../../utils/file";
import { pullFaceEmbeddings, putFaceIndex } from "./embedding";
import { indexFaces } from "./index-face";
+import { getKV } from "@/next/kv";
/**
* The MLWorker state machine.
@@ -125,14 +126,33 @@ export class MLWorker {
}
async backfillq() {
- console.log("backfillq");
- await wait(0);
+ await backfill();
}
}
// TODO-ML: Temorarily disable
// expose(MLWorker);
+/**
+ * Find out files which need to be indexed. Then index the next batch of them.
+ */
+const backfill = async () => {
+ const userID = await getKV("userID");
+
+ // const files = await syncWithLocalFilesAndGetFilesToIndex(
+ // userID,
+ // batchSize,
+ // );
+
+ // if (syncContext.outOfSyncFiles.length > 0) {
+ // await this.syncFiles(syncContext);
+ // }
+
+ // const error = syncContext.error;
+ // const nOutOfSyncFiles = syncContext.outOfSyncFiles.length;
+ // return !error && nOutOfSyncFiles > 0;
+
+}
/**
* Index faces in a file, save the persist the results locally, and put them
* on remote.
diff --git a/web/packages/shared/storage/localStorage/index.ts b/web/packages/shared/storage/localStorage/index.ts
index f0607347e7..d4b0351da2 100644
--- a/web/packages/shared/storage/localStorage/index.ts
+++ b/web/packages/shared/storage/localStorage/index.ts
@@ -74,8 +74,8 @@ export const migrateKVToken = async (user: unknown) => {
typeof user == "object" &&
"id" in user &&
typeof user.id == "number"
- ? await setKV("uid", user.id)
- : await removeKV("uid");
+ ? await setKV("userID", user.id)
+ : await removeKV("userID");
user &&
typeof user == "object" &&