Skip to content

Commit db5c243

Browse files
refactor(solid): use ensureBaseStructureReady in startBaseStructureAfterLogin
1 parent 17f8d6e commit db5c243

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

api/server/services/SolidStorage.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -616,25 +616,7 @@ async function ensureBaseStructureReady(req) {
616616
function startBaseStructureAfterLogin(req) {
617617
const openidId = req?.user?.openidId;
618618
if (!openidId) return Promise.resolve();
619-
const existing = baseStructureBatonMap.get(openidId);
620-
if (existing) return existing;
621-
622-
const promise = (async () => {
623-
try {
624-
const { authenticatedFetch, podUrl } = await getSolidFetchAndPodUrl(req);
625-
await ensureBaseStructure(podUrl, authenticatedFetch);
626-
logger.debug('[SolidStorage] Base structure ready after login', { openidId });
627-
} catch (err) {
628-
baseStructureBatonMap.delete(openidId);
629-
logger.warn('[SolidStorage] Base structure init after login failed', {
630-
openidId,
631-
error: err?.message,
632-
});
633-
throw err;
634-
}
635-
})();
636-
baseStructureBatonMap.set(openidId, promise);
637-
return promise;
619+
return ensureBaseStructureReady(req);
638620
}
639621

640622
/**

0 commit comments

Comments
 (0)