mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Refactor CLI.py to use database instances for API calls
This commit is contained in:
parent
e66aea1e14
commit
f64b6945e5
1 changed files with 9 additions and 0 deletions
|
|
@ -180,6 +180,15 @@ class CLI(ApiCaller):
|
|||
self.__logger.error("USE_REDIS is set to yes but REDIS_HOST or REDIS_SENTINEL_HOSTS is not set, disabling redis")
|
||||
self.__use_redis = False
|
||||
|
||||
if Path(sep, "usr", "sbin", "nginx").exists() and self.__integration != "Linux":
|
||||
return super().__init__(
|
||||
[
|
||||
API(
|
||||
f"http://127.0.0.1:{self.__get_variable('API_HTTP_PORT', '5000')}",
|
||||
host=self.__get_variable("API_SERVER_NAME", "bwapi"),
|
||||
)
|
||||
]
|
||||
)
|
||||
super().__init__()
|
||||
for db_instance in self.__db.get_instances():
|
||||
self.apis.append(API(f"http://{db_instance['hostname']}:{db_instance['port']}", db_instance["server_name"]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue