让nodejs heroku应用程序在空闲之前做一些事情
make nodejs heroku app do something before become idle
我在 heroku 中托管了 nodejs web。我想让我的 app.js 在闲置之前做点什么。就像我有一个名为 prepareIdle() 的函数,我希望我的 app.js 在空闲之前调用它。提前致谢
尝试收听信号 SIGTERM
并在 30 秒内做任何您想做的事。 30 秒后,您将收到 SIGKILL
信号
我在 heroku 中托管了 nodejs web。我想让我的 app.js 在闲置之前做点什么。就像我有一个名为 prepareIdle() 的函数,我希望我的 app.js 在空闲之前调用它。提前致谢
尝试收听信号 SIGTERM
并在 30 秒内做任何您想做的事。 30 秒后,您将收到 SIGKILL
信号