Try to find a split point

This commit is contained in:
Manav Rathi
2024-05-19 19:02:46 +05:30
parent c2e42266a6
commit f692638ede
2 changed files with 10 additions and 5 deletions

View File

@@ -24,6 +24,15 @@ export interface IndexStatus {
peopleIndexSynced: boolean;
}
/**
* TODO(MR): Transient type with an intersection of values that both existing
* and new types during the migration will have. Eventually we'll store the the
* server ML data shape here exactly.
*/
export interface MinimalFileData {
mlVersion: number;
}
interface Config {}
export const ML_SEARCH_CONFIG_NAME = "ml-search";

View File

@@ -316,7 +316,7 @@ class MachineLearningService {
}
private async syncFile(enteFile: EnteFile, localFile?: globalThis.File) {
const oldMlFile = await this.getMLFileData(enteFile.id);
const oldMlFile = await mlIDbStorage.getFile(enteFile.id);
if (oldMlFile && oldMlFile.mlVersion) {
return oldMlFile;
}
@@ -327,10 +327,6 @@ class MachineLearningService {
return newMlFile;
}
private async getMLFileData(fileId: number) {
return mlIDbStorage.getFile(fileId);
}
private async persistMLFileSyncError(enteFile: EnteFile, e: Error) {
try {
await mlIDbStorage.upsertFileInTx(enteFile.id, (mlFileData) => {