| 31 | |
| 32 | let _agent |
| 33 | function getHttpsAgent() { |
| 34 | if (!_agent) { |
| 35 | const agentOptions = { |
| 36 | // The most important option. This is false by default. |
| 37 | keepAlive: true, |
| 38 | // 32 because it's what's recommended here |
| 39 | // https://docs.microsoft.com/en-us/azure/app-service/app-service-web-nodejs-best-practices-and-troubleshoot-guide#my-node-application-is-making-excessive-outbound-calls |
| 40 | maxSockets: 32, |
| 41 | } |
| 42 | _agent = new Agent(agentOptions) |
| 43 | } |
| 44 | return _agent |
| 45 | } |
| 46 | |
| 47 | export default class Hydro { |
| 48 | constructor({ secret, endpoint, forceDisableMock } = {}) { |