api: set up env watcher only after cluster is initialized
This commit is contained in:
@@ -9,6 +9,7 @@ import { fileURLToPath } from "url";
|
||||
import { env, isCluster } from "./config.js"
|
||||
import { Red } from "./misc/console-text.js";
|
||||
import { initCluster } from "./misc/cluster.js";
|
||||
import { setupEnvWatcher } from "./core/env.js";
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -24,6 +25,10 @@ if (env.apiURL) {
|
||||
await initCluster();
|
||||
}
|
||||
|
||||
if (env.envFile) {
|
||||
setupEnvWatcher();
|
||||
}
|
||||
|
||||
runAPI(express, app, __dirname, cluster.isPrimary);
|
||||
} else {
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user