Merge pull request #764 from Cooldude2606/refactor/config-file-path

Refactor config file paths into the config class
This commit is contained in:
Daniel authored and GitHub committed 2025-05-19 20:52:14 +02:00
commit a39911d667
15 files changed
+311 -119

No files matched your search

+1 -8
View File
@@ -50,7 +50,6 @@ export default class Controller {
clusterLogger: winston.Logger;
/** Array of plugin info objects for known plugins */
pluginInfos: lib.PluginNodeEnvInfo[];
configPath: string;
/** Controller config. */
config: lib.ControllerConfig;
app: Application;
@@ -155,7 +154,6 @@ export default class Controller {
constructor(
clusterLogger: winston.Logger,
pluginInfos: lib.PluginNodeEnvInfo[],
configPath: string,
config: lib.ControllerConfig,
/**
@@ -184,7 +182,6 @@ export default class Controller {
) {
this.clusterLogger = clusterLogger;
this.pluginInfos = pluginInfos;
this.configPath = configPath;
this.config = config;
this.app = express();
@@ -584,12 +581,8 @@ export default class Controller {
});
private async _saveDataInternal() {
if (this.config.dirty) {
this.config.dirty = false;
await lib.safeOutputFile(this.configPath, JSON.stringify(this.config, null, "\t"));
}
await Promise.all([
this.config.save(),
this.systems.save(),
this.hosts.save(),
this.instances.save(),