Removes Logger dependency from setup_data_folder

Logger was only used to log when a new folder was created, and was making that the setup needed to be done on the main of pisad and cli instead of __init__, which seems a better fit
This commit is contained in:
Sergi Delgado Segura
2020-01-23 19:32:40 +01:00
parent dce7b4d39e
commit 5c75b1f40d
5 changed files with 6 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import os
import pisa.conf as conf
from common.tools import check_conf_fields, setup_logging, extend_paths
from common.tools import check_conf_fields, setup_logging, extend_paths, setup_data_folder
from pisa.utils.auth_proxy import AuthServiceProxy
HOST = "localhost"
@@ -34,4 +34,5 @@ conf_fields = extend_paths(conf_fields["DATA_FOLDER"]["value"], conf_fields)
# Sanity check fields and build config dictionary
config = check_conf_fields(conf_fields)
setup_data_folder(config.get("DATA_FOLDER"))
setup_logging(config.get("SERVER_LOG_FILE"), LOG_PREFIX)

View File

@@ -3,7 +3,6 @@ from sys import argv, exit
from signal import signal, SIGINT, SIGQUIT, SIGTERM
from common.logger import Logger
from common.tools import setup_data_folder
from pisa import config, LOG_PREFIX
from pisa.api import API
@@ -34,8 +33,6 @@ def main():
signal(SIGQUIT, handle_signals)
logger.info("Starting PISA")
setup_data_folder(config.get("DATA_FOLDER"), logger)
db_manager = DBManager(config.get("DB_PATH"))
if not can_connect_to_bitcoind():