From aeaef329e79fb4cdb527cad031ca9fe1182753fe Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:10:04 +0300 Subject: [PATCH] wip --- pm2.config.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pm2.config.js diff --git a/pm2.config.js b/pm2.config.js new file mode 100644 index 00000000..b7f797bc --- /dev/null +++ b/pm2.config.js @@ -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 + } + ] +}