Switch Threads scheduling back to systemd as sunrise user

This commit is contained in:
2026-11-02 05:03:17 +09:00
parent 586e59608e
commit 62afa4b272
3 changed files with 99 additions and 145 deletions
-19
View File
@@ -1,19 +0,0 @@
const path = require('node:path');
module.exports = {
apps: [{
name: 'sunrise-threads',
cwd: path.resolve(__dirname, '..'),
script: process.execPath,
args: ['server/threads/worker.ts'],
interpreter: 'none',
instances: 1,
exec_mode: 'fork',
autorestart: true,
restart_delay: 60000,
kill_timeout: 15000,
watch: false,
time: true,
env: { NODE_ENV: 'production', TZ: 'Asia/Seoul' },
}],
};
+22
View File
@@ -0,0 +1,22 @@
[Unit]
Description=Sunrise Threads daily capture and publishing worker
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=0
[Service]
Type=simple
User=sunrise
WorkingDirectory=/opt/sunrise
Environment=NODE_ENV=production
Environment=TZ=Asia/Seoul
Environment=HOME=/home/sunrise
ExecStart=/usr/bin/node /opt/sunrise/server/threads/worker.ts
Restart=on-failure
RestartSec=60
TimeoutStopSec=15
KillMode=control-group
UMask=0022
[Install]
WantedBy=multi-user.target