feat(v4.1.16): add keepAlive, add lint script, edit lint errors
This commit is contained in:
@@ -5,4 +5,3 @@ export * from './response/v5-spreadtrading';
|
||||
export * from './shared';
|
||||
export * from './shared-v5';
|
||||
export * from './websockets';
|
||||
|
||||
|
||||
@@ -138,9 +138,17 @@ export default abstract class BaseRestClient {
|
||||
|
||||
// If enabled, configure a https agent with keepAlive enabled
|
||||
if (this.options.keepAlive) {
|
||||
// Extract existing https agent parameters, if provided, to prevent the keepAlive flag from overwriting
|
||||
// an existing https agent completely
|
||||
const existingHttpsAgent = this.globalRequestOptions.httpsAgent as
|
||||
| https.Agent
|
||||
| undefined;
|
||||
const existingAgentOptions = existingHttpsAgent?.options || {};
|
||||
|
||||
// For more advanced configuration, raise an issue on GitHub or use the "networkOptions"
|
||||
// parameter to define a custom httpsAgent with the desired properties
|
||||
this.globalRequestOptions.httpsAgent = new https.Agent({
|
||||
...existingAgentOptions,
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: this.options.keepAliveMsecs,
|
||||
});
|
||||
|
||||
@@ -751,6 +751,7 @@ export class WebsocketClient extends BaseWebsocketClient<
|
||||
|
||||
if (!reqId) {
|
||||
this.logger.error(
|
||||
// eslint-disable-next-line max-len
|
||||
'WS API response is missing reqId - promisified workflow could get stuck. If this happens, please get in touch with steps to reproduce. Trace:',
|
||||
{
|
||||
wsKey,
|
||||
|
||||
Reference in New Issue
Block a user