Skip to content

Commit 6b13e75

Browse files
committed
add separate timeout for GLV info APIs
1 parent 2214fae commit 6b13e75

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/composites/glv-token/src/config/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ export const config = new AdapterConfig(
6060
required: true,
6161
default: 'https://arbitrum-api.gmxinfra.io/tokens',
6262
},
63+
GLV_INFO_API_TIMEOUT_MS: {
64+
description:
65+
'The amount of time the request to the GLV info APIs should wait before timing out. ' +
66+
'Distinct from timeout used to make requests to the EAs which can be set with API_TIMEOUT',
67+
type: 'number',
68+
default: 10_000,
69+
},
6370
METADATA_REFRESH_INTERVAL_MS: {
6471
description: 'The amount of time the metadata should be refreshed',
6572
type: 'number',

packages/composites/glv-token/src/transport/base.ts

+4
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ export abstract class BaseGlvTransport<
109109
const requestConfig = {
110110
url: this.settings.TOKEN_INFO_API,
111111
method: 'GET',
112+
timeout: this.settings.GLV_INFO_API_TIMEOUT_MS,
112113
}
113114

115+
logger.info('Fetching token info')
114116
const response = await this.requester.request<{ tokens: Token[] }>(
115117
JSON.stringify(requestConfig),
116118
requestConfig,
@@ -127,8 +129,10 @@ export abstract class BaseGlvTransport<
127129
const requestConfig = {
128130
url: this.settings.MARKET_INFO_API,
129131
method: 'GET',
132+
timeout: this.settings.GLV_INFO_API_TIMEOUT_MS,
130133
}
131134

135+
logger.info('Fetching market info')
132136
const response = await this.requester.request<{ markets: Market[] }>(
133137
JSON.stringify(requestConfig),
134138
requestConfig,

0 commit comments

Comments
 (0)