krakenjs / kraken-js

An express-based Node.js web application bootstrapping module.
Other
4.95k stars 459 forks source link

shutdown middleware assumes a single server. #224

Open totherik opened 10 years ago

totherik commented 10 years ago

If a client started both http and https servers on the same kraken app, shutdown middleware would only attempt to stop one server.

aredridel commented 9 years ago

I wonder if there's a way to solve this. 1:N app:server is tough for this kind of thing, since the app doesn't really know about the servers that will call it.

dougwilson commented 9 years ago

Potentially server can be changed to an array and you can just accumulate the list of servers you have seen so far at https://github.com/krakenjs/kraken-js/blob/d37c1bc3b498163b5d89e850252b0bc8b2033f72/middleware/shutdown.js#L65 instead of only saving the server from the first request.