diff --git a/packages/retry-plugin/src/fetch-retry.ts b/packages/retry-plugin/src/fetch-retry.ts index 40547d08e7..78c8cf85e8 100644 --- a/packages/retry-plugin/src/fetch-retry.ts +++ b/packages/retry-plugin/src/fetch-retry.ts @@ -33,7 +33,7 @@ async function fetchWithRetry({ } catch (error) { if (retryTimes <= 0) { logger.log( - `[ Module Federation RetryPlugin ]: retry failed after ${retryTimes} times for url: ${url}, now will try fallbackUrl url`, + `${PLUGIN_IDENTIFIER}: retry failed after ${retryTimes} times for url: ${url}, now will try fallbackUrl url`, ); if (fallback && typeof fallback === 'function') { diff --git a/packages/retry-plugin/src/util.ts b/packages/retry-plugin/src/util.ts index 5768177fef..b47a906c38 100644 --- a/packages/retry-plugin/src/util.ts +++ b/packages/retry-plugin/src/util.ts @@ -1,4 +1,8 @@ -import { defaultRetries, defaultRetryDelay } from './constant'; +import { + defaultRetries, + defaultRetryDelay, + PLUGIN_IDENTIFIER, +} from './constant'; import type { ScriptCommonRetryOption } from './types'; import logger from './logger'; @@ -22,7 +26,7 @@ export function scriptCommonRetry void>({ let attempts = 0; while (attempts - 1 < retryTimes) { try { - beforeExecuteRetry && beforeExecuteRetry(); + beforeExecuteRetry(); retryResponse = await retryFn(...args); break; } catch (error) { @@ -36,7 +40,7 @@ export function scriptCommonRetry void>({ throw error; } logger.log( - `[ Module Federation RetryPlugin ]: script resource retrying ${attempts} times`, + `${PLUGIN_IDENTIFIER}: script resource retrying ${attempts} times`, ); await new Promise((resolve) => setTimeout(resolve, retryDelay)); }