Skip to content

Commit

Permalink
fix: increase fetch package size timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
changfeng committed Jun 10, 2023
1 parent 9fb7c08 commit 003c7f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { workspaceRoot } from 'workspace-root';

import { memoizeAsync, getPkgSize as _getPkgSize } from './utils';

export interface Options {}
export interface Options {
fetchPkgInfoTimeout?: number;
}

const getWorkspaceRootFolder = memoizeAsync(async () => {
let workspaceRootFolder = await workspaceRoot();
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function getPkgSize(name: string, version: string) {
resp = await axios.get<GetPkgSizeResponseData>(
`https://bundlephobia.com/api/size?package=${name}@${version}`,
{
timeout: 6666,
timeout: 10 * 1000,
},
);
} catch {
Expand Down

0 comments on commit 003c7f9

Please sign in to comment.