forked from iptv-org/epg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpm2.config.js
More file actions
35 lines (31 loc) · 762 Bytes
/
pm2.config.js
File metadata and controls
35 lines (31 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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'
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
});
}
module.exports = { apps };