donejs / done-ssr

Server Side Rendering for DoneJS
https://www.npmjs.com/package/done-ssr
MIT License
23 stars 11 forks source link

Allow done-ssr timeouts to exit the processs cleanly #699

Closed mikemitchel closed 4 years ago

mikemitchel commented 4 years ago

Debugging timeouts can be tricky, and having the option to exit the process cleanly would be helpful for logging and also to allow redundant processes to take over future calls to done-ssr.

Something like this: if (option.exitOnTimeout) process.exit(1) after line: https://github.com/donejs/done-ssr/blob/1e06c8a0b66844994e5ae1e64f86b6b5f08bc02f/lib/ssr-stream.js#L112

This would also require adding exitOnTimeout to the options object/docs.

@MarcGodard please add any notes you may have from your recent issues that might be helpful here - thank you!

MarcGodard commented 4 years ago

I have reduced the timeout from happening, however, once it does happen, I notice memory starts leaking. So exiting would be best as the app isn't in a stable condition.

MarcGodard commented 4 years ago

The version: "done-ssr-middleware": "^3.0.1-1" has been very successful. Please let me know when this is merged into the lib.