Add editable weather captions and manage Threads scheduling with PM2
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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' },
|
||||
}],
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=Capture sunrise and publish to Threads
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
StartLimitIntervalSec=1h
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=sunrise
|
||||
WorkingDirectory=/opt/sunrise
|
||||
ExecStart=/usr/bin/node /opt/sunrise/server/threads/run.ts
|
||||
TimeoutStartSec=8h
|
||||
Restart=on-failure
|
||||
RestartSec=60s
|
||||
UMask=0022
|
||||
@@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Prepare daily sunrise capture at 03:00 Korea time
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 03:00:00 Asia/Seoul
|
||||
Persistent=true
|
||||
AccuracySec=1s
|
||||
Unit=sunrise-threads.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user