mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
Make PM2 worker memory restart opt-in
This commit is contained in:
+7
-1
@@ -4,6 +4,12 @@ const dockerLogConfig = {
|
||||
merge_logs: true,
|
||||
};
|
||||
|
||||
const stratumWorkerMemoryLimit = process.env.STRATUM_WORKER_MAX_MEMORY_RESTART;
|
||||
const stratumWorkerMemoryRestart =
|
||||
stratumWorkerMemoryLimit && !['0', 'false', 'off', 'disabled'].includes(stratumWorkerMemoryLimit.toLowerCase())
|
||||
? { max_memory_restart: stratumWorkerMemoryLimit }
|
||||
: {};
|
||||
|
||||
module.exports = {
|
||||
apps: [
|
||||
// API instance
|
||||
@@ -42,7 +48,7 @@ module.exports = {
|
||||
script: './dist/main.js',
|
||||
instances: parseInt(process.env.STRATUM_WORKERS || '2', 10),
|
||||
exec_mode: "cluster",
|
||||
max_memory_restart: process.env.STRATUM_WORKER_MAX_MEMORY_RESTART || '4096M',
|
||||
...stratumWorkerMemoryRestart,
|
||||
env: {
|
||||
MASTER: 'false',
|
||||
API_ENABLED: 'false',
|
||||
|
||||
Reference in New Issue
Block a user