Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] can't SIGINT when using library #10

Open
victorperin opened this issue Nov 14, 2018 · 3 comments
Open

[BUG] can't SIGINT when using library #10

victorperin opened this issue Nov 14, 2018 · 3 comments

Comments

@victorperin
Copy link

Seems to relate with this bug here:
jprichardson/node-death#7

@victorperin
Copy link
Author

After SIGINT, I aways get this error:

IllegalOperationError: Channel closed
     at Channel.<anonymous (/usr/src/app/node_modules/amqplib/lib/channel.js:149:11)
     at Channel.C.reject (/usr/src/app/node_modules/amqplib/lib/channel_model.js:244:8)
     at Timeout.msg.reject [as _onTimeout] (/usr/src/app/node_modules/@autolotto/bunnyhop/build/lib/engines/default.engine.js:208:18)
     at ontimeout (timers.js:436:11)
     at tryOnTimeout (timers.js:300:5)
     at listOnTimeout (timers.js:263:5)
     at Timer.processTimers (timers.js:223:10)

@victorperin
Copy link
Author

I think we can use this package as alternative:
https://github.com/jtlapp/node-cleanup

@victorperin
Copy link
Author

I think this comment on node-death is a good way to start.

Try this:

const onDeathCallback = () => {
    try {
        shutdownRedis();
        logInfo('Redis');
        shutdownMongoose();
        logInfo('Mongo');
    } catch (err) {
        logError('death.config.onDeathCallback', 'ERR_GRACEFUL_CONN_SHUTDOWN', err);
    }
};

Originally posted by @ukrbublik in jprichardson/node-death#7 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant