refactor: support cancel during retry

This commit is contained in:
Kevin Yue 2023-09-01 11:35:22 +08:00
parent 69502b22a9
commit c4fa91f6ea

View File

@ -64,15 +64,20 @@ export const connectPortalAtom = atom(
throw err; throw err;
} }
if (err instanceof AbnormalPortalConfigError) { if (!(err instanceof AbnormalPortalConfigError)) {
logger.info(
`Got abnormal portal config: ${err.message}, retrying...`
);
prelogin = await portalService.prelogin(portal);
continue;
} else {
throw err; throw err;
} }
logger.info(
`Got abnormal portal config: ${err.message}, retrying...`
);
set(statusAtom, "prelogin");
prelogin = await portalService.prelogin(portal);
const isProcessing = get(isProcessingAtom);
if (!isProcessing) {
logger.info("Operation cancelled");
break;
}
} }
} }
} else { } else {