Skip to content

Commit 5e5bced

Browse files
fix: increase default fetch timeout for push command (#2778)
1 parent 9212985 commit 5e5bced

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.changeset/sour-parrots-cheat.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { logger } from '@redocly/openapi-core';
22
import type { ReadStream } from 'node:fs';
33
import type { Readable } from 'node:stream';
44

5-
import { DEFAULT_FETCH_TIMEOUT, SOURCE_FETCH_TIMEOUT } from '../../utils/constants.js';
5+
import { DEFAULT_FETCH_TIMEOUT } from '../../utils/constants.js';
66
import fetchWithTimeout, { type FetchWithTimeoutOptions } from '../../utils/fetch-with-timeout.js';
77
import { version } from '../../utils/package.js';
88
import type {
@@ -125,7 +125,7 @@ class RemotesApi {
125125
const response = await this.client.request(
126126
`${this.domain}/api/orgs/${organizationId}/projects/${projectId}/source`,
127127
{
128-
timeout: SOURCE_FETCH_TIMEOUT,
128+
timeout: DEFAULT_FETCH_TIMEOUT,
129129
method: 'GET',
130130
headers: {
131131
'Content-Type': 'application/json',
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const OTEL_URL = 'https://otel.cloud.redocly.com';
22
export const OTEL_TRACES_URL = process.env.OTEL_TRACES_URL || `${OTEL_URL}/v1/traces`;
3-
export const DEFAULT_FETCH_TIMEOUT = 3000;
4-
export const SOURCE_FETCH_TIMEOUT = 6000;
3+
export const DEFAULT_FETCH_TIMEOUT = 6000;
54
export const ANONYMOUS_ID_CACHE_FILE = 'redocly-cli-anonymous-id';

0 commit comments

Comments
 (0)