chore: prevent launching if proxy count is 0
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
|
||||
# Castorsrm
|
||||
config.json
|
||||
build/
|
||||
|
||||
# Logs
|
||||
|
||||
|
||||
@ -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}'`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user