Skip to content

Commit a57773c

Browse files
authored
Changed environment variable API_REQUEST_TIMEOUT maxValue to 120 sec (used to be 20 sec)
1 parent 10f6dbb commit a57773c

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.1.6 (January 24, 2024)
2+
* Changed environment variable `API_REQUEST_TIMEOUT` maxValue to 120 sec (used to be 20 sec)
3+
14
## 3.1.5 (December 29, 2022)
25
* Updated @elasticio/maester-client to v5.0.1
36

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ const result = await new AttachmentProcessor().getAttachment('http://example.com
250250

251251
### Environment variables
252252
* **API_RETRIES_COUNT** (defaults to 3): maximum amount of retries for 5xx errors. If server still responding 5xx, error will be thrown.
253-
* **API_REQUEST_TIMEOUT** (defaults to 15000): specifies the number of milliseconds before the request times out. If the request takes longer than timeout, the request will be aborted.
253+
* **API_REQUEST_TIMEOUT** (defaults to 15000, min: 500, max: 120000): specifies the number of milliseconds before the request times out. If the request takes longer than timeout, the request will be aborted.
254254

255255
- `axiosReqWithRetryOnServerError` (use with `.call()` to pass context, implement it as a method of class with `logger` and `cfg` (value of configuration object for current action) values in a constructor) - function which makes axios request by specified request-config, making logging and error handling:
256256
1. If 5xx error occurred, it will be retried maximum `API_RETRIES_COUNT` times, each retry will be delayed with `exponentialSleep` function.
257-
2. If 4xx error occurred - error will be throw.
257+
2. If 4xx error occurred - error will be thrown.
258258
3. If action `cfg` has `doNotThrow404` set to true: 404 error won't be treated as error. <br>
259259
Look on examples below.
260260
- `getErrMsg` - forms error message from axios-response.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elastic.io/component-commons-library",
3-
"version": "3.1.5",
3+
"version": "3.1.6-dev.1",
44
"description": "Library for most common component development cases",
55
"author": {
66
"name": "elastic.io GmbH",

src/externalApi/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const ENV_API_RETRIES_COUNT = process.env.API_RETRIES_COUNT ? parseInt(process.e
1515
export const API_REQUEST_TIMEOUT = {
1616
minValue: 500,
1717
defaultValue: 15000,
18-
maxValue: 20000
18+
maxValue: 120000
1919
} as const;
2020

2121
/**

0 commit comments

Comments
 (0)