This commit is contained in:
Manav Rathi
2024-05-29 12:28:56 +05:30
parent f0f3af96d1
commit bb46e98e85
3 changed files with 8 additions and 5 deletions

View File

@@ -12,19 +12,22 @@ import { watchReset } from "./watch";
* See: [Note: Do not throw during logout].
*/
export const logout = (watcher: FSWatcher) => {
const ignoreError = (label: string, e: unknown) =>
log.error(`Ignoring error during logout (${label})`, e);
try {
watchReset(watcher);
} catch (e) {
log.error("Ignoring error during logout (FS watch)", e);
ignoreError("FS watch", e);
}
try {
clearConvertToMP4Results();
} catch (e) {
log.error("Ignoring error during logout (convert-to-mp4)", e);
ignoreError("convert-to-mp4", e);
}
try {
clearStores();
} catch (e) {
log.error("Ignoring error during logout (native stores)", e);
ignoreError("native stores", e);
}
};

View File

@@ -14,7 +14,7 @@ import mlWorkManager from "./machineLearning/mlWorkManager";
* See: [Note: Do not throw during logout].
*/
export const photosLogout = async () => {
const ignoreError = (e: unknown, label: string) =>
const ignoreError = (label: string, e: unknown) =>
log.error(`Ignoring error during logout (${label})`, e);
await accountLogout();

View File

@@ -17,7 +17,7 @@ import { logout as remoteLogout } from "../api/user";
* gets in an unexpected state.
*/
export const accountLogout = async () => {
const ignoreError = (e: unknown, label: string) =>
const ignoreError = (label: string, e: unknown) =>
log.error(`Ignoring error during logout (${label})`, e);
try {