Update pm2.config.js

This commit is contained in:
freearhey 2025-07-17 17:43:51 +03:00
parent 3789adcd5f
commit 7d808ebfd7
1 changed files with 8 additions and 7 deletions

View File

@ -1,3 +1,9 @@
const grab = process.env.SITE
? `npm run grab -- --site=${process.env.SITE} ${
process.env.CLANG ? `--lang=${process.env.CLANG}` : ''
} --output=public/guide.xml`
: 'npm run grab -- --channels=channels.xml --output=public/guide.xml'
module.exports = {
apps: [
{
@ -9,15 +15,10 @@ module.exports = {
},
{
name: 'grab',
script: process.env.SITE
? `npm run grab -- --site=${process.env.SITE} ${
process.env.CLANG ? `--lang=${process.env.CLANG}` : ''
} --output=public/guide.xml`
: 'npm run grab -- --channels=channels.xml --output=public/guide.xml',
cron_restart: process.env.CRON_SCHEDULE || null,
script: `npx chronos -e "${grab}" -p "${process.env.CRON_SCHEDULE}" -l`,
instances: 1,
watch: false,
autorestart: false
autorestart: true
}
]
}