Open matb33 opened 7 years ago
Read the readme, your app/server needs to respond to the 'shutdown' message. https://github.com/gradealabs/bullseye#graceful-shutdown
Also, look at the "Ready message" section in the API section. You should signal ready
if the --waitForReady
flag is set when calling bullseye.
https://github.com/gradealabs/bullseye#api
The generator we maintain has code that handles the ready message and the shutdown message for use already. If you are still encountering issues then it might be unrelated to bullseye, but the file watchers and/or the call to restart()
on the bullseye process handle. Anyway, let me know if it still occurs after adding a handler for the shutdown message.
Just to be clear, I've been using the generator.
The problem then is in the generated code. You are wrapping it in a if (process.env.NODE_ENV === 'development') {
so it won't work unless you set NODE_ENV to development
somewhere.
Currently it doesn't look like the generator sets a dev
entry under scripts
in package.json:
https://github.com/gradealabs/generator-feathers/blob/esm/generators/app/configs/package.json.js#L42
The one I have that I pulled from our client project looks like this:
"dev": "node --require ts-node/register ./scripts/dev",
That won't be enough -- we'll need to change it to the following for it to work with the generated code:
"dev": "NODE_ENV=development node --require ts-node/register ./scripts/dev",
I've confirmed that this works.
After extensive debugging, it appears as though this line is the cause: https://github.com/gradealabs/bullseye/blob/master/src/index.ts#L135
I'm unsure why it's
.send('shutdown')
. It should be.kill('SIGINT')
, which I've confirmed fixes the issue.