/[sudobot]/trunk/ecosystem.config.js
ViewVC logotype

Diff of /trunk/ecosystem.config.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 571 by rakin, Mon Jul 29 17:29:17 2024 UTC revision 572 by rakinar2, Mon Jul 29 17:51:37 2024 UTC
# Line 1  Line 1 
1  module.exports = {  const { existsSync } = require("fs");
2    const { resolve } = require("path");
3    
4    const logDirectoryExists = existsSync(resolve(__dirname, "logs"));
5    
6    /**
7     * @type {import("@onesoftnet/pm2-config").PM2Config}
8     */
9    const config = {
10      apps: [      apps: [
11          {          {
12              script: 'build/index.js',              name: "sudobot",
13                script: "build/out/main.js",
14              env_production: {              env_production: {
15                  NODE_ENV: "production"                  NODE_ENV: "production"
16              },              },
17              env_development: {              autorestart: true,
18                  NODE_ENV: "development"              log_date_format: "YYYY-MM-DD HH:mm:ss Z",
19              },              log_file: logDirectoryExists ? "logs/debug.log" : null,
20              max_memory_restart: "850M"              error: logDirectoryExists ? "logs/error.log" : null
21          }          }
22      ],      ]
23  };  };
24    
25    module.exports = config;

Legend:
Removed from v.571  
changed lines
  Added in v.572

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26