fix an error due to a change in structure

This commit is contained in:
Kiryl
2021-10-04 13:48:37 +03:00
parent 594a8f0c8c
commit 236233fff1
3 changed files with 5 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ def configure_file_logger(name, filename='logs/converter_log.log', filemode='w+'
logging_format='%(asctime)s - %(levelname)s - %(message)s'):
logger = logging.getLogger(name)
folder_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
folder_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(folder_path, filename)
file_handler = logging.FileHandler(file_path, mode=filemode)
@@ -84,7 +84,7 @@ def local_convert_book(filename, locker):
logger = configure_file_logger('consumer', logging_format='%(asctime)s - %(levelname)s - %(message)s')
logger.info(f'Start processing book-{filename}.')
folder_path = os.path.dirname(os.path.dirname(os.path.abspath("__file__")))
folder_path = os.path.dirname(os.path.abspath("__file__"))
output_path = Path(os.path.join(folder_path, f'json/{filename}.json'))
try:
book = DocxBook(book_id=filename,
@@ -114,7 +114,7 @@ def local_run(books):
def server_run():
logger = configure_file_logger('consumer')
folder_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
folder_path = os.path.dirname(os.path.abspath(__file__))
config_path = Path(os.path.join(folder_path, "config/queue_config.json"))
with open(config_path, "r") as f:
conf_param = json.load(f)