Skip to content

Instantly share code, notes, and snippets.

@h1code2
Last active September 27, 2020 02:44
Show Gist options
  • Save h1code2/f2397c2242d0331e63a4f67fae357d6b to your computer and use it in GitHub Desktop.
Save h1code2/f2397c2242d0331e63a4f67fae357d6b to your computer and use it in GitHub Desktop.
PM2多进程运行Python程序配置文件 #pm2 #Python

PM2多进程运行Python程序配置文件参考

let apps =  [
    {
      name: 'youtube-spider',
      cwd: '/srv/spider/wuyi_spider',
      script: 'venv/bin/python cli.py youtube_basic_spider_task --max_threads 5',
      watch: false,
      number:2,
    },
]

apps.forEach(function(app){
    let number = app.number;
    if ([undefined,1].includes(number)){
        return
    }
    for (let index = 0; index < (number -1); index++) {
        apps.push(app)
    }
})


module.exports = {
    apps: apps
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment