Start working on clustering again

This commit is contained in:
Manav Rathi
2024-08-27 13:50:45 +05:30
parent 49895a7d7f
commit 15ba2dd297
2 changed files with 11 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import {
isMLEnabled,
isMLSupported,
mlStatusSnapshot,
wipClusterEnable,
} from "@/new/photos/services/ml";
import { parseDateComponents } from "@/new/photos/services/search";
import type {
@@ -341,8 +342,8 @@ function convertSuggestionToSearchQuery(option: Suggestion): Search {
// let done = false;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function getAllPeople(_limit: number = undefined) {
if (!(await wipClusterEnable())) return [];
return [];
// if (!(await wipClusterEnable())) return [];
// if (done) return [];
// done = true;

View File

@@ -6,6 +6,7 @@ import { isDesktop } from "@/base/app";
import { assertionFailed } from "@/base/assert";
import { blobCache } from "@/base/blob-cache";
import { ensureElectron } from "@/base/electron";
import { isDevBuild } from "@/base/env";
import log from "@/base/log";
import type { Electron } from "@/base/types/ipc";
import { ComlinkWorker } from "@/base/worker/comlink-worker";
@@ -14,6 +15,7 @@ import type { EnteFile } from "@/new/photos/types/file";
import { ensure } from "@/utils/ensure";
import { throttled } from "@/utils/promise";
import { proxy, transfer } from "comlink";
import { isInternalUser } from "../feature-flags";
import { getRemoteFlag, updateRemoteFlag } from "../remote-store";
import type { UploadItem } from "../upload/types";
import { regenerateFaceCrops } from "./crop";
@@ -318,14 +320,13 @@ export const indexNewUpload = (enteFile: EnteFile, uploadItem: UploadItem) => {
// // TODO-Cluster temporary import here
// let last: SearchPerson[] | undefined;
// /**
// * WIP! Don't enable, dragon eggs are hatching here.
// */
// export const wipClusterEnable = async () => {
// if (!process.env.NEXT_PUBLIC_ENTE_WIP_CL) return false;
// if (!isDevBuild || !(await isInternalUser())) return false;
// return true;
// };
/**
* WIP! Don't enable, dragon eggs are hatching here.
*/
export const wipClusterEnable = async () =>
process.env.NEXT_PUBLIC_ENTE_WIP_CL &&
isDevBuild &&
(await isInternalUser());
// export const wipCluster = async () => {
// if (!(await wipClusterEnable())) return;