You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ When creating a client instance, you need to specify the following options:
61
61
| headers | Optional | {} | The object with custom headers for internal http client. |
62
62
| debug | Optional | false | This flag allows seeing the logs of the client. Useful for debugging. |
63
63
| isLaunchMergeRequired | Optional | false | Allows client to merge launches into one at the end of the run via saving their UUIDs to the temp files at filesystem. At the end of the run launches can be merged using `mergeLaunches` method. Temp file format: `rplaunch-${launch_uuid}.tmp`. |
64
-
| restClientConfig | Optional | Not set |`axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options eg. `timeout`. For debugging and displaying logs you can set `debug: true`. |
64
+
| restClientConfig | Optional | Not set |`axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options eg. `timeout`. For debugging and displaying logs you can set `debug: true`. Use the `retry` property (number or [`axios-retry`](https://github.com/softonic/axios-retry#options) config) to customise automatic retries. |
65
65
| launchUuidPrint | Optional | false | Whether to print the current launch UUID. |
66
66
| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`. |
67
67
| token | Deprecated | Not set | Use `apiKey` instead. |
@@ -88,6 +88,26 @@ There is a timeout on axios requests. If for instance the server your making a r
88
88
89
89
You can simply change this timeout by adding a `timeout` property to `restClientConfig` with your desired numeric value (in _ms_) or *0* to disable it.
90
90
91
+
### Retry configuration
92
+
93
+
The client retries failed HTTP calls up to 6 times with an exponential backoff (starting at 200 ms and capping at 5 s) and resets the axios timeout before each retry. Provide a `retry` option in `restClientConfig` to change that behaviour. The value can be either a number (overriding just the retry count) or a full [`axios-retry` configuration object](https://github.com/softonic/axios-retry#options):
94
+
95
+
```javascript
96
+
constaxiosRetry=require('axios-retry').default;
97
+
98
+
constclient=newRPClient({
99
+
// ... other options
100
+
restClientConfig: {
101
+
retry: {
102
+
retries:5,
103
+
retryDelay:axiosRetry.exponentialDelay,
104
+
},
105
+
},
106
+
});
107
+
```
108
+
109
+
Setting `retry: 0` disables automatic retries.
110
+
91
111
### checkConnect
92
112
93
113
`checkConnect` - asynchronous method for verifying the correctness of the client connection
0 commit comments