island: Rename logging_dir_path -> _logging_dir in MongoDbProcess

This commit is contained in:
Mike Salvatore 2021-06-02 15:16:18 -04:00
parent a3bd432538
commit 1e21446bb8
2 changed files with 5 additions and 5 deletions

View File

@ -13,13 +13,13 @@ TERMINATE_TIMEOUT = 10
class MongoDbProcess:
def __init__(self, db_dir: str, logging_dir_path: str):
def __init__(self, db_dir: str, logging_dir: str):
"""
@param db_dir: Path where a folder for database contents will be created
@param logging_dir_path: Path to a folder where mongodb logs will be created
@param logging_dir: Path to a folder where mongodb logs will be created
"""
self._db_dir = db_dir
self.logging_dir_path = logging_dir_path
self._logging_dir = logging_dir
self._process = None
def start(self):
@ -44,7 +44,7 @@ class MongoDbProcess:
mongo_run_cmd = MongoDbProcess._build_mongo_launch_cmd(MONGO_EXECUTABLE_PATH, self._db_dir)
logger.info(f"Mongodb will be launched with command: {' '.join(mongo_run_cmd)}.")
mongo_log_path = os.path.join(self.logging_dir_path, MONGO_LOG_FILENAME)
mongo_log_path = os.path.join(self._logging_dir, MONGO_LOG_FILENAME)
logger.info(f"Mongodb log will be available at {mongo_log_path}.")
with open(mongo_log_path, "w") as log:

View File

@ -24,7 +24,7 @@ logger = logging.getLogger(__name__)
def start_mongodb(config_options: IslandConfigOptions) -> MongoDbProcess:
db_dir = _create_db_dir(config_options.data_dir)
mongo_db_process = MongoDbProcess(db_dir=db_dir, logging_dir_path=config_options.data_dir)
mongo_db_process = MongoDbProcess(db_dir=db_dir, logging_dir=config_options.data_dir)
mongo_db_process.start()
return mongo_db_process