close HTTP keep-alive connections when shutting down

This commit is contained in:
Brian Gough 2014-12-23 16:46:31 +00:00
parent 55c4e220fa
commit 74fc095913

View file

@ -62,6 +62,12 @@ app.use (req, res, next) ->
app.get "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.getFile app.get "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.getFile
app.post "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.insertFile app.post "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.insertFile
app.use (req, res, next) ->
if not appIsOk
# when shutting down, close any HTTP keep-alive connections
res.set 'Connection', 'close'
next()
app.put "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.copyFile app.put "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.copyFile
app.del "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.deleteFile app.del "/project/:project_id/file/:file_id", keyBuilder.userFileKey, fileController.deleteFile