search

Home  >  Q&A  >  body text

node.js - 电脑休眠本地 node 服务器可以保持运行状态吗?

想做一个定时任务,比如每天早上七点发送消息.

但是电脑每天都会休眠,休眠服务器好像也跟着休眠了,反正是不再推送了

有没有办法能让服务器不休眠?

PHP中文网PHP中文网2785 days ago420

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 16:24:34

    Just set the computer not to sleep

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:24:34

    forever or pm2 can achieve never sleep; I use forever, install forever globally, and then go to the directory where you run node. If the usual startup is node app.js, just use forever start app.js here. . forever

    reply
    0
  • Cancelreply