Skip to content

Commit 1ba0c16

Browse files
haesoo-ydanpeen
andauthored
chore(retry-plugin): remove unnecessary null-check before calling beforeExecuteRetry (#3361)
Co-authored-by: Karina <[email protected]>
1 parent f7983f9 commit 1ba0c16

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/retry-plugin/src/fetch-retry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function fetchWithRetry({
3333
} catch (error) {
3434
if (retryTimes <= 0) {
3535
logger.log(
36-
`[ Module Federation RetryPlugin ]: retry failed after ${retryTimes} times for url: ${url}, now will try fallbackUrl url`,
36+
`${PLUGIN_IDENTIFIER}: retry failed after ${retryTimes} times for url: ${url}, now will try fallbackUrl url`,
3737
);
3838

3939
if (fallback && typeof fallback === 'function') {

packages/retry-plugin/src/util.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { defaultRetries, defaultRetryDelay } from './constant';
1+
import {
2+
defaultRetries,
3+
defaultRetryDelay,
4+
PLUGIN_IDENTIFIER,
5+
} from './constant';
26
import type { ScriptCommonRetryOption } from './types';
37
import logger from './logger';
48

@@ -22,7 +26,7 @@ export function scriptCommonRetry<T extends (...args: any[]) => void>({
2226
let attempts = 0;
2327
while (attempts - 1 < retryTimes) {
2428
try {
25-
beforeExecuteRetry && beforeExecuteRetry();
29+
beforeExecuteRetry();
2630
retryResponse = await retryFn(...args);
2731
break;
2832
} catch (error) {
@@ -36,7 +40,7 @@ export function scriptCommonRetry<T extends (...args: any[]) => void>({
3640
throw error;
3741
}
3842
logger.log(
39-
`[ Module Federation RetryPlugin ]: script resource retrying ${attempts} times`,
43+
`${PLUGIN_IDENTIFIER}: script resource retrying ${attempts} times`,
4044
);
4145
await new Promise((resolve) => setTimeout(resolve, retryDelay));
4246
}

0 commit comments

Comments
 (0)