This commit is contained in:
freearhey 2025-01-02 11:10:04 +03:00
parent 1b62393008
commit aeaef329e7

29
pm2.config.js Normal file
View file

@ -0,0 +1,29 @@
const grabArgs = [
'--channels=channels.xml',
'--output=public/guide.xml',
process.env.MAX_CONNECTIONS ? `--maxConnections=${process.env.MAX_CONNECTIONS}` : null,
process.env.DAYS ? `--days=${process.env.DAYS}` : null,
process.env.GZIP === 'true' ? '--gzip' : null
]
.filter(Boolean)
.join(' ')
module.exports = {
apps: [
{
name: 'serve',
script: 'npm run serve -- public',
instances: 1,
watch: false,
autorestart: true
},
{
name: 'grab',
script: `npm run grab -- ${grabArgs}`,
cron_restart: process.env.CRON_SCHEDULE,
instances: 1,
watch: false,
autorestart: false
}
]
}