File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,5 @@ export const DEFAULT_API_VERSION = 'v1beta';
2828export const PACKAGE_VERSION = version ;
2929
3030export const LANGUAGE_TAG = 'gl-js' ;
31+
32+ export const DEFAULT_FETCH_TIMEOUT_MS = 180 * 1000 ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { ApiSettings } from '../types/internal';
2121import {
2222 DEFAULT_API_VERSION ,
2323 DEFAULT_BASE_URL ,
24+ DEFAULT_FETCH_TIMEOUT_MS ,
2425 LANGUAGE_TAG ,
2526 PACKAGE_VERSION
2627} from '../constants' ;
@@ -145,9 +146,9 @@ export async function makeRequest(
145146 ) ;
146147 // Timeout is 180s by default
147148 const timeoutMillis =
148- requestOptions ?. timeout !== undefined
149+ requestOptions ?. timeout !== undefined && requestOptions . timeout >= 0
149150 ? requestOptions . timeout
150- : 180 * 1000 ;
151+ : DEFAULT_FETCH_TIMEOUT_MS ;
151152 const abortController = new AbortController ( ) ;
152153 fetchTimeoutId = setTimeout ( ( ) => abortController . abort ( ) , timeoutMillis ) ;
153154 request . fetchOptions . signal = abortController . signal ;
You can’t perform that action at this time.
0 commit comments