From feb3e648391463b2b108efb664e53b897f6b5ccf Mon Sep 17 00:00:00 2001 From: X1a0t <405028157@qq.com> Date: Tue, 19 Sep 2023 03:19:56 +0800 Subject: [PATCH] feat: apply higher priority for doc request (#4401) --- packages/graphql/src/fetcher.ts | 2 +- packages/workspace/src/providers/cloud/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/graphql/src/fetcher.ts b/packages/graphql/src/fetcher.ts index 36f61b97e7..b660c0581c 100644 --- a/packages/graphql/src/fetcher.ts +++ b/packages/graphql/src/fetcher.ts @@ -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 => { const startTime = new Date().toISOString(); diff --git a/packages/workspace/src/providers/cloud/index.ts b/packages/workspace/src/providers/cloud/index.ts index adac93dd11..b374451d5e 100644 --- a/packages/workspace/src/providers/cloud/index.ts +++ b/packages/workspace/src/providers/cloud/index.ts @@ -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();