From 31374ee2d628058d41844f0007c6ea3a3f8fbbc7 Mon Sep 17 00:00:00 2001 From: XLor Date: Fri, 20 Sep 2024 23:25:19 +0800 Subject: [PATCH] fix(animegarden): must run retry --- packages/animegarden/src/garden/index.ts | 4 ++-- packages/animegarden/src/garden/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/animegarden/src/garden/index.ts b/packages/animegarden/src/garden/index.ts index bc52bdbb4..799a3c52f 100644 --- a/packages/animegarden/src/garden/index.ts +++ b/packages/animegarden/src/garden/index.ts @@ -39,7 +39,7 @@ export async function fetchResources Promise, options: T = {} as T ): Promise> { - const { baseURL = DefaultBaseURL, retry = 1 } = options; + const { baseURL = DefaultBaseURL, retry = 0 } = options; const url = stringifySearchURL(baseURL, options); @@ -191,7 +191,7 @@ export async function fetchResourceDetail( href: string, options: FetchResourceDetailOptions = {} ): Promise<(ResourceDetail & { id: number }) | undefined> { - const { baseURL = DefaultBaseURL, retry = 1 } = options; + const { baseURL = DefaultBaseURL, retry = 0 } = options; const url = new URL(`${provider}/detail/${href}`, baseURL); const resp = await retryFn(async () => { diff --git a/packages/animegarden/src/garden/utils.ts b/packages/animegarden/src/garden/utils.ts index c639020e2..1bcfe445a 100644 --- a/packages/animegarden/src/garden/utils.ts +++ b/packages/animegarden/src/garden/utils.ts @@ -9,7 +9,7 @@ export async function retryFn(fn: () => Promise, count: number): Promise