add optional nats monitoring

This commit is contained in:
wh1te909 2022-10-18 00:12:57 +00:00
parent 22e1a4cf41
commit d71ee194e1
1 changed files with 5 additions and 0 deletions

View File

@ -209,6 +209,11 @@ def reload_nats() -> None:
},
}
if "NATS_HTTP_PORT" in os.environ:
config["http_port"] = int(os.getenv("NATS_HTTP_PORT")) # type: ignore
elif hasattr(settings, "NATS_HTTP_PORT"):
config["http_port"] = settings.NATS_HTTP_PORT # type: ignore
conf = os.path.join(settings.BASE_DIR, "nats-rmm.conf")
with open(conf, "w") as f:
json.dump(config, f)