Skip to content

Commit c743b2e

Browse files
fix: increase default fetch timeout for push command (#2777)
1 parent fef0709 commit c743b2e

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.changeset/six-bobcats-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@redocly/cli": patch
3+
---
4+
5+
Increased the default fetch timeout used by the `push` command to better support slower uploads.

packages/cli/src/reunite/api/api-client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { yellow, red } from 'colorette';
22
import fetchWithTimeout, {
33
type FetchWithTimeoutOptions,
44
DEFAULT_FETCH_TIMEOUT,
5-
SOURCE_FETCH_TIMEOUT,
65
} from '../../utils/fetch-with-timeout';
76

87
import type { ReadStream } from 'fs';
@@ -110,7 +109,7 @@ class RemotesApi {
110109
const response = await this.client.request(
111110
`${this.domain}/api/orgs/${organizationId}/projects/${projectId}/source`,
112111
{
113-
timeout: SOURCE_FETCH_TIMEOUT,
112+
timeout: DEFAULT_FETCH_TIMEOUT,
114113
method: 'GET',
115114
headers: {
116115
'Content-Type': 'application/json',

packages/cli/src/utils/fetch-with-timeout.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getProxyAgent } from '@redocly/openapi-core';
22

3-
export const DEFAULT_FETCH_TIMEOUT = 3000;
4-
export const SOURCE_FETCH_TIMEOUT = 6000;
3+
export const DEFAULT_FETCH_TIMEOUT = 6000;
54

65
export type FetchWithTimeoutOptions = RequestInit & {
76
timeout?: number;

0 commit comments

Comments
 (0)