From 9fc3db537187bf248f1b5f627145672a6396d9aa Mon Sep 17 00:00:00 2001 From: Seth Holladay Date: Mon, 21 Nov 2016 12:50:33 -0500 Subject: [PATCH] =?UTF-8?q?Hack=20around=20Hoxy=E2=80=99s=20bad=20exit=20b?= =?UTF-8?q?ehavior.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hoxy has a server buried in its internals that it uses to accomplish some neat tricks for serving static files. Unfortunately, there’s no public way to shutdown this server. That conflicts with what we want to do to shutdown gracefully upon receiving SIGINT. For now, we’re just going to force quit after a reasonable period. Details: https://github.com/greim/hoxy/issues/88 --- bin/proxy.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/proxy.js b/bin/proxy.js index c63bb22..e55f255 100755 --- a/bin/proxy.js +++ b/bin/proxy.js @@ -51,6 +51,14 @@ const server = new PageProxy(serverOptions); handleQuit(() => { server.stop(); + // TODO: Properly fix Hoxy's shenanigans. https://github.com/greim/hoxy/issues/88 + const hack = setTimeout( + () => { + process.exit(0); + }, + 600 + ); + hack.unref(); }); server.start().then(() => {