feat: apply higher priority for doc request (#4401)

This commit is contained in:
X1a0t 2023-09-19 03:19:56 +08:00 committed by GitHub
parent 65bb30558e
commit feb3e64839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -217,7 +217,7 @@ export const gqlFetcherFactory = (endpoint: string) => {
export const fetchWithTraceReport = async (
input: RequestInfo | URL,
init?: RequestInit,
init?: RequestInit & { priority?: 'auto' | 'low' | 'high' }, // https://github.com/microsoft/TypeScript/issues/54472
traceOptions?: { event: string }
): Promise<Response> => {
const startTime = new Date().toISOString();

View File

@ -19,7 +19,10 @@ export async function downloadBinaryFromCloud(
}
const response = await fetchWithTraceReport(
runtimeConfig.serverUrlPrefix +
`/api/workspaces/${rootGuid}/docs/${pageGuid}`
`/api/workspaces/${rootGuid}/docs/${pageGuid}`,
{
priority: 'high',
}
);
if (response.ok) {
const arrayBuffer = await response.arrayBuffer();