From c2e50c619d219b5467d81ea4d8ba349aeedf03c9 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 18 Dec 2014 16:55:11 +0000 Subject: [PATCH] request restart on unhandled exceptions to avoid memory leak --- services/filestore/app.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/filestore/app.coffee b/services/filestore/app.coffee index 3c8fcde1c1..a29943931e 100644 --- a/services/filestore/app.coffee +++ b/services/filestore/app.coffee @@ -37,6 +37,8 @@ app.use (req, res, next) -> requestDomain.add req requestDomain.add res requestDomain.on "error", (err)-> + # request a shutdown to prevent memory leaks + appIsOk = false setTimeout(-> if !res.headerSent res.send(500)