Skip to content

Commit

Permalink
Server: check if server is running before closing it (Needs to be fix…
Browse files Browse the repository at this point in the history
…ed after nodejs/node#4735)
  • Loading branch information
José Moreira committed Jan 18, 2016
1 parent 5a1d46e commit 5e46179
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ Server.prototype.destroy =
Server.prototype.close =
Server.prototype.terminate =
function APIServer$destroy () {
this.http.close()

// Change this to `http.listening` once node supports it
// nodejs/node#4735
if ( this.http._handle ) {
this.http.close()
}

this.redis.disconnect()
}

0 comments on commit 5e46179

Please sign in to comment.