【问题标题】:make nodejs heroku app do something before become idle让nodejs heroku应用程序在空闲之前做一些事情
【发布时间】:2021-08-27 13:37:07
【问题描述】:

我在 heroku 中托管了 nodejs 网络。我想让我的 app.js 在闲置之前做一些事情。就像我有一个名为 prepareIdle() 的函数,我希望我的 app.js 在空闲之前调用它。提前致谢

【问题讨论】:

    标签: node.js express heroku


    【解决方案1】:

    尝试收听信号SIGTERM,并在 30 秒内做任何你想做的事。 30 秒后,您将收到SIGKILL 信号

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多