chore: prevent launching if proxy count is 0

This commit is contained in:
2025-04-14 01:23:09 +07:00
parent 92cb93b4cb
commit a63e92e91f
2 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
# Castorsrm
config.json
build/
# Logs

View File

@ -20,6 +20,12 @@ if (fs.existsSync("config.json")) {
// Write the new config file in case we updated something.
await fs.promises.writeFile("config.json", config.toJSON());
// Validate configuration
if (config.proxy.count < 1) {
logger.error("Proxy count must be greater than 0.");
process.exit(1);
}
logger.level = process.env.LOG_LEVEL || config.logger.level;
logger.info(`Logger level set to '${logger.level}'`);