mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-28 13:08:57 +00:00
Ignore cache invalidation error from local backend (#2752)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'gitbook': patch
|
||||
---
|
||||
|
||||
Ignore cache invalidation error from local backend
|
||||
+13
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user