chore: prevent launching if proxy count is 0
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Castorsrm
|
# Castorsrm
|
||||||
config.json
|
config.json
|
||||||
|
build/
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,12 @@ if (fs.existsSync("config.json")) {
|
|||||||
// Write the new config file in case we updated something.
|
// Write the new config file in case we updated something.
|
||||||
await fs.promises.writeFile("config.json", config.toJSON());
|
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.level = process.env.LOG_LEVEL || config.logger.level;
|
||||||
logger.info(`Logger level set to '${logger.level}'`);
|
logger.info(`Logger level set to '${logger.level}'`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user