Skip to content

Commit 06e600a

Browse files
authored
Merge pull request #1 from txase/addTCPKeepAlive
Set TCP Keep Alive between queries
2 parents 1092057 + ecb58db commit 06e600a

File tree

2 files changed

+460
-372
lines changed

2 files changed

+460
-372
lines changed

index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,20 @@ class Client_AuroraDataMySQL extends Client_MySQL { // eslint-disable-line camel
6666

6767
_driver () {
6868
const RDSDataService = require('aws-sdk/clients/rdsdataservice');
69+
const https = require('https');
6970

70-
return new RDSDataService(this.config.connection.sdkConfig);
71+
const agent = new https.Agent({
72+
keepAlive: true
73+
});
74+
75+
const config = {
76+
httpOptions: {
77+
agent
78+
},
79+
...(this.config.connection.sdkConfig || {})
80+
};
81+
82+
return new RDSDataService(config);
7183
}
7284

7385
acquireRawConnection () {

0 commit comments

Comments
 (0)