make sure shutdown only happens once

This commit is contained in:
Brian Gough 2014-12-23 16:55:34 +00:00
parent d3fa6b4a01
commit d5478a8ebb

View file

@ -113,9 +113,10 @@ port = settings.internal.filestore.port or 3009
host = settings.internal.filestore.host or "localhost"
beginShutdown = () ->
appIsOk = false
server.close()
logger.log "server will stop accepting connections"
if appIsOk
appIsOk = false
server.close()
logger.log "server will stop accepting connections"
server.on "close", () ->
logger.log "closed all connections"