Try to find a split point
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user