Skip to content

Commit aa5dc16

Browse files
committed
Remove error cache reset - cache failures so worker fails fast
1 parent e803adc commit aa5dc16

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/mdx.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,13 @@ async function getRegistryHashWithRetry(
109109
/**
110110
* Get the registry hash, using cached value if available.
111111
* This ensures we only fetch the registry once per worker process.
112+
* If the fetch fails, the error is cached so subsequent calls fail fast.
112113
*/
113114
function getRegistryHash(): Promise<string> {
114115
if (!cachedRegistryHash) {
115116
// eslint-disable-next-line no-console
116117
console.info('Fetching registry hash for the first time in this worker');
117-
cachedRegistryHash = getRegistryHashWithRetry().catch(err => {
118-
// Reset cache on error so next call will retry
119-
cachedRegistryHash = null;
120-
throw err;
121-
});
118+
cachedRegistryHash = getRegistryHashWithRetry();
122119
}
123120
return cachedRegistryHash;
124121
}

0 commit comments

Comments
 (0)