From 0963f8904918bd74b455da7751db4c59d23170d2 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Tue, 7 Sep 2021 20:58:23 -0700 Subject: [PATCH] fix(memory-leak): Resetting app after 8 hours --- bin/server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/server.js b/bin/server.js index 4bd59fd..4a0245a 100644 --- a/bin/server.js +++ b/bin/server.js @@ -94,6 +94,13 @@ class Server { // Attach the other IPFS controllers await controllers.attachControllers(app) + // ipfs-coord has a memory leak. This app shuts down after 8 hours. It + // expects to be run by Docker or pm2, which can automatically restart + // the app. + setTimeout(function () { + process.exit(0) + }, 60000 * 60 * 8) + return app } catch (err) { console.error('Could not start server. Error: ', err)