Ignore cache invalidation error from local backend (#2752)

This commit is contained in:
Greg Bergé
2025-01-15 14:13:10 +01:00
committed by GitHub
parent 994ebff8c1
commit 128ad20280
2 changed files with 18 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'gitbook': patch
---
Ignore cache invalidation error from local backend
+13 -1
View File
@@ -60,7 +60,19 @@ export async function revalidateTags(tags: string[]): Promise<{
stats[entry.key].backends[backend.name] = { set: false };
});
await backend.del(unclearedEntries);
try {
await backend.del(unclearedEntries);
} catch (error) {
if (error instanceof Error && error.message === 'Too many subrequests.') {
if (backend.replication === 'local') {
console.warn(
`Too many subrequests, skipping cache del for local backend ${backend.name}`,
);
return;
}
}
throw error;
}
}
}),
);