Browse Source

Fix http server init/close

Pavel Ševčík 3 years ago
parent
commit
4512aee51d
No known key found for this signature in database GPG Key ID: CFA54E4C0CD58DF0
  1. 8
      lib/http-server/http-server.js

8
lib/http-server/http-server.js

@ -68,9 +68,9 @@ class HttpServer {
*/
start() {
// Start a http server
this.server = this.app.listen(this.port, this.host, () => {
this.server = this.app.listen(this.port, () => {
Logger.info(`HttpServer : Listening on ${this.host}:${this.port}`)
})
}, this.host)
this.server.timeout = 600 * 1000
// @see https://github.com/nodejs/node/issues/13391
@ -83,8 +83,8 @@ class HttpServer {
* Stop the http server
*/
stop() {
if (this.app === null) return
this.app.close()
if (this.server == null) return
this.server.close()
}
/**

Loading…
Cancel
Save