nodemon is not restarting the server when using node-java package

走远了吗. 提交于 2019-12-06 11:16:12

It seems that node-java somehow magically 'overrides' what's happening when receiving SIGUSR2 signal. In such a case, the SIGUSR2 signal (used by nodemon) to restart the app may fail terminating the app.

(Quick) Fix:

after the node-java has screwed your SIGUSR2 handling mechanism, add the following snippet of code:

process.once('SIGUSR2', function() {
  process.kill(process.pid, 'SIGUSR2')
})

note that you must do this AFTER the node-java (or something which uses it, in my case it is node-tika) does its 'job' (in my case, immediately after requiring node-tika).

To be honest, I have only very little understanding, why this works and I'll be glad if someone can shed more light on this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!