Skip to content

Commit

Permalink
feat(server): support USE_JOB env on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerblue committed Sep 24, 2024
1 parent 3a27513 commit a955cf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions compose/compose.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
COS_REGION: "your_region"
HOST: "0.0.0.0"
NODE_WORKERS: 1
USE_JOB: 1
volumes:
- /data/thenac-paste/server/logs:/root/.pm2/logs
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions server/pm2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const apps = [
},
node_args: ['--unhandled-rejections=warn'],
},
{
process.env.USE_JOB === '1' && {
name: 'paste-job-clear',
script: `./server/src/jobs/clear.js`,
log_date_format: 'YYYY-MM-DD HH:mm:ss',
Expand All @@ -32,7 +32,7 @@ const apps = [
},
node_args: ['--unhandled-rejections=warn'],
},
];
].filter(Boolean);

module.exports = {
apps,
Expand Down

0 comments on commit a955cf9

Please sign in to comment.