Skip to content

Commit 0a5507c

Browse files
authored
update timeout settings
1 parent 6eb3de2 commit 0a5507c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/callTool.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ async function callTool(
126126
if (['GET', 'DELETE'].includes(method || '')) body = null;
127127

128128
const request = new OpenApi.OpenApiRequest({ query, body });
129-
const runtime = new Util.RuntimeOptions({});
129+
// runtime default settings https://github.com/aliyun/tea-util/blob/5f4bdebef3b57d33207b6bc44af6ed5e1a009959/ts/test/client.spec.ts#L133
130+
const runtime = new Util.RuntimeOptions({
131+
readTimeout: process.env.OPEN_API_READ_TIMEOUT ? Number(process.env.OPEN_API_READ_TIMEOUT) : 10000,
132+
connectTimeout: process.env.OPEN_API_CONNECT_TIMEOUT ? Number(process.env.OPEN_API_CONNECT_TIMEOUT) : 10000,
133+
});
130134
// 查看 https://github.com/aliyun/darabonba-openapi/blob/master/ts/src/client.ts
131135
const res = await (agent as any)?.callApi?.(apiRequestConfigs, request, runtime);
132136
let result: IAlibabaCloudOpenApiJsonResponse['body'] | null = null;

0 commit comments

Comments
 (0)