Skip to content

Commit

Permalink
Hack around Hoxy’s bad exit behavior.
Browse files Browse the repository at this point in the history
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: greim/hoxy#88
  • Loading branch information
sholladay committed Nov 21, 2016
1 parent d7d5c1a commit 9fc3db5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 9fc3db5

Please sign in to comment.