This commit is contained in:
Manav Rathi 2024-05-15 13:30:26 +05:30
parent 1648229f4c
commit eba910e202
No known key found for this signature in database
2 changed files with 7 additions and 11 deletions

View file

@ -31,7 +31,7 @@ export const photosLogout = async () => {
const electron = globalThis.electron;
if (electron) {
try {
await mlWorkManager.setMlSearchEnabled(false);
await mlWorkManager.logout();
} catch (e) {
log.error("Ignoring error during logout (ML)", e);
}

View file

@ -175,16 +175,12 @@ class MLWorkManager {
}
}
private async logoutHandler() {
log.info("logoutHandler");
try {
this.stopSyncJob();
this.mlSyncJob = undefined;
await this.terminateLiveSyncWorker();
await mlIDbStorage.clearMLDB();
} catch (e) {
log.error("Failed in ML logout Handler", e);
}
async logout() {
this.setMlSearchEnabled(false);
this.stopSyncJob();
this.mlSyncJob = undefined;
await this.terminateLiveSyncWorker();
await mlIDbStorage.clearMLDB();
}
private async fileUploadedHandler(arg: {