forked from p15670423/monkey
island: Rename logging_dir_path -> _logging_dir in MongoDbProcess
This commit is contained in:
parent
a3bd432538
commit
1e21446bb8
|
@ -13,13 +13,13 @@ TERMINATE_TIMEOUT = 10
|
||||||
|
|
||||||
|
|
||||||
class MongoDbProcess:
|
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 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._db_dir = db_dir
|
||||||
self.logging_dir_path = logging_dir_path
|
self._logging_dir = logging_dir
|
||||||
self._process = None
|
self._process = None
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
@ -44,7 +44,7 @@ class MongoDbProcess:
|
||||||
mongo_run_cmd = MongoDbProcess._build_mongo_launch_cmd(MONGO_EXECUTABLE_PATH, self._db_dir)
|
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)}.")
|
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}.")
|
logger.info(f"Mongodb log will be available at {mongo_log_path}.")
|
||||||
|
|
||||||
with open(mongo_log_path, "w") as log:
|
with open(mongo_log_path, "w") as log:
|
||||||
|
|
|
@ -24,7 +24,7 @@ logger = logging.getLogger(__name__)
|
||||||
def start_mongodb(config_options: IslandConfigOptions) -> MongoDbProcess:
|
def start_mongodb(config_options: IslandConfigOptions) -> MongoDbProcess:
|
||||||
db_dir = _create_db_dir(config_options.data_dir)
|
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()
|
mongo_db_process.start()
|
||||||
|
|
||||||
return mongo_db_process
|
return mongo_db_process
|
||||||
|
|
Loading…
Reference in New Issue