diff --git a/api/server/db/mongo/__init__.py b/api/server/db/mongo/__init__.py index d4446e862..aae45a9f8 100644 --- a/api/server/db/mongo/__init__.py +++ b/api/server/db/mongo/__init__.py @@ -11,12 +11,12 @@ def __init__(self): self.async_client = motor.motor_asyncio.AsyncIOMotorClient(username=config.DB_USERNAME, password=config.get_from_file(config.MONGO_KEY_PATH), host=config.MONGO_HOST, - port=config.MONGO_PORT) + port=config.get_int("MONGO_PORT")) self.reg_client = pymongo.MongoClient(username=config.DB_USERNAME, password=config.get_from_file(config.MONGO_KEY_PATH), host=config.MONGO_HOST, - port=config.MONGO_PORT) + port=config.get_int("MONGO_PORT")) self.init_db() diff --git a/common/config.py b/common/config.py index fe40fafcb..745a50740 100644 --- a/common/config.py +++ b/common/config.py @@ -164,10 +164,10 @@ class Config: # DOCKER_TLS_VERIFY = os.getenv("DOCKER_TLS_VERIFY", "1") # DOCKER_CERT_PATH = os.getenv("DOCKER_CERT_PATH", "/Path/to/certs/for/remote/docker/daemon") - def get_int(self, key, default): + def get_int(self, key, default=None): return sint(getattr(self, key), default) - def get_float(self, key, default): + def get_float(self, key, default=None): return sfloat(getattr(self, key), default) def load_config(self):