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

Loading…
Cancel
Save