Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

pm2定时任务未能重启

$
0
0

描述: pm2来定时执行一个邮件发送程序,如果程序是通过process.exit来退出的,就无法重新启动。而如果是正常退出的则能定时启动 ecosystem.json配置如下:

{
  "apps": [{
      "name": "index",
      "script": "index.js",
      "error_file": "err.log",
      "out_file": "out.log",
      "merge_logs": true,
      "log_date_format": "YYYY-MM-DD HH:mm Z",
      "min_uptime": 100,
      "cron_restart": "* * * * *",
      "autorestart": false
    }
  ]
}

Viewing all articles
Browse latest Browse all 14821

Trending Articles