* This represents our S3 connector. * @constructor * @param {Object} config - Configuration object * @param {Worker} [worker=null] - Track the worker when using cluster
(config, worker)
| 71 | * @param {Worker} [worker=null] - Track the worker when using cluster |
| 72 | */ |
| 73 | constructor(config, worker) { |
| 74 | this.config = config; |
| 75 | this.worker = worker; |
| 76 | this.cluster = config.isCluster; |
| 77 | this.servers = []; |
| 78 | http.globalAgent = new HttpAgent({ |
| 79 | keepAlive: true, |
| 80 | freeSocketTimeout: arsenal.constants.httpClientFreeSocketTimeout, |
| 81 | }); |
| 82 | |
| 83 | process.on('SIGINT', this.cleanUp.bind(this)); |
| 84 | process.on('SIGHUP', this.cleanUp.bind(this)); |
| 85 | process.on('SIGQUIT', this.cleanUp.bind(this)); |
| 86 | process.on('SIGTERM', this.cleanUp.bind(this)); |
| 87 | process.on('SIGPIPE', () => { }); |
| 88 | // This will pick up exceptions up the stack |
| 89 | process.on('uncaughtException', err => { |
| 90 | // If just send the error object results in empty |
| 91 | // object on server log. |
| 92 | logger.fatal('caught error', { |
| 93 | error: err.message, |
| 94 | stack: err.stack, |
| 95 | workerId: this.worker ? this.worker.id : undefined, |
| 96 | workerPid: this.worker ? this.worker.process.pid : undefined, |
| 97 | }); |
| 98 | this.caughtExceptionShutdown(); |
| 99 | }); |
| 100 | this.started = false; |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Route requests on 'internal s3' port |
nothing calls this directly
no test coverage detected