Files
epg/pm2.config.js

35 lines
762 B
JavaScript
Raw Normal View History

2025-07-17 17:43:51 +03:00
const grab = process.env.SITE
? `npm run grab -- --site=${process.env.SITE} ${process.env.CLANG ? `--lang=${process.env.CLANG}` : ''
} --output=public/guide.xml`
2025-07-17 17:43:51 +03:00
: 'npm run grab -- --channels=channels.xml --output=public/guide.xml'
const apps = [
{
name: 'serve',
script: 'npx serve -- public',
instances: 1,
watch: false,
autorestart: true
},
{
name: 'grab',
script: `npx chronos -e "${grab}" -p "${process.env.CRON_SCHEDULE}" -l`,
instances: 1,
watch: false,
autorestart: true
}
];
if (process.env.RUN_AT_STARTUP === 'true') {
apps.push({
name: 'grab-at-startup',
script: grab,
instances: 1,
autorestart: false,
watch: false,
max_restarts: 1
});
2025-01-02 11:10:04 +03:00
}
module.exports = { apps };