forked from LiveCarta/BookConverter
Download preset on condition
This commit is contained in:
@@ -18,9 +18,9 @@ from src.epub_converter.epub_solver import EpubBook
|
||||
def local_convert_book(book_type: [DocxBook, EpubBook], book_id: int, main_logger: logging.Logger, params: dict):
|
||||
main_logger.info(f"Start processing book-{book_id}.")
|
||||
try:
|
||||
json_file_path = "books/json/9781614382264.json"
|
||||
json_file_path = "books/json/9781264269044.json"
|
||||
book = book_type(book_id=book_id, main_logger=main_logger, **params)
|
||||
book.conversion(json_file_path)
|
||||
book.conversion_local(json_file_path)
|
||||
except Exception as exc:
|
||||
raise exc
|
||||
main_logger.info(f"Book-{book_id} has been proceeded.")
|
||||
@@ -59,6 +59,7 @@ def callback(ch, method, properties, body: bytes, main_logger: logging.Logger, l
|
||||
}
|
||||
|
||||
thread = Thread(target=convert_book, kwargs=params)
|
||||
# thread = Thread(target=local_convert_book, kwargs=params)
|
||||
thread.start()
|
||||
logging.log(logging.INFO, f"Active threads: {active_count()}.")
|
||||
# print(f"Active threads: {active_count()}.")
|
||||
|
||||
Reference in New Issue
Block a user