mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
feat: apply higher priority for doc request (#4401)
This commit is contained in:
@@ -217,7 +217,7 @@ export const gqlFetcherFactory = (endpoint: string) => {
|
|||||||
|
|
||||||
export const fetchWithTraceReport = async (
|
export const fetchWithTraceReport = async (
|
||||||
input: RequestInfo | URL,
|
input: RequestInfo | URL,
|
||||||
init?: RequestInit,
|
init?: RequestInit & { priority?: 'auto' | 'low' | 'high' }, // https://github.com/microsoft/TypeScript/issues/54472
|
||||||
traceOptions?: { event: string }
|
traceOptions?: { event: string }
|
||||||
): Promise<Response> => {
|
): Promise<Response> => {
|
||||||
const startTime = new Date().toISOString();
|
const startTime = new Date().toISOString();
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ export async function downloadBinaryFromCloud(
|
|||||||
}
|
}
|
||||||
const response = await fetchWithTraceReport(
|
const response = await fetchWithTraceReport(
|
||||||
runtimeConfig.serverUrlPrefix +
|
runtimeConfig.serverUrlPrefix +
|
||||||
`/api/workspaces/${rootGuid}/docs/${pageGuid}`
|
`/api/workspaces/${rootGuid}/docs/${pageGuid}`,
|
||||||
|
{
|
||||||
|
priority: 'high',
|
||||||
|
}
|
||||||
);
|
);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
|
|||||||
Reference in New Issue
Block a user