mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Read
This commit is contained in:
parent
910013572d
commit
532a9f64ff
@ -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.
|
||||
|
@ -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" &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user