Skip to content

Commit 66699f2

Browse files
committed
registry cache logs
1 parent e5d53b0 commit 66699f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mdx.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ async function getRegistryHashWithRetry(
111111
*/
112112
function getRegistryHash(): Promise<string> {
113113
if (!cachedRegistryHash) {
114+
// eslint-disable-next-line no-console
115+
console.info('Fetching registry hash for the first time in this worker');
114116
cachedRegistryHash = getRegistryHashWithRetry().catch(err => {
115117
// Reset cache on error so next call will retry
116118
cachedRegistryHash = null;
@@ -600,6 +602,10 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
600602
try {
601603
const registryHash = await getRegistryHash();
602604
cacheKey = `${sourceHash}-${registryHash}`;
605+
// eslint-disable-next-line no-console
606+
console.info(
607+
`Using registry-aware cache for ${sourcePath} (registry hash: ${registryHash.slice(0, 8)}...)`
608+
);
603609
} catch (err) {
604610
// If we can't get registry hash, skip cache for this file
605611
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)