Skip to content

Commit

Permalink
feat: fc print trace
Browse files Browse the repository at this point in the history
Signed-off-by: 117503445 <[email protected]>
  • Loading branch information
117503445 committed Sep 27, 2023
1 parent bdcba80 commit af06e22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/flow_pdf/flow_pdf/fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from htutil import file
import shutil
import traceback

logger = create_main_logger()
if version == "dev":
Expand Down Expand Up @@ -76,19 +77,19 @@
stem = Path(file_k).stem

file_task = dir_output / stem / "task.json"
file_doc = dir_output / stem / 'output' / "doc.json"
file_doc = dir_output / stem / "output" / "doc.json"

if file_doc.exists():
logger.info(f'file_doc exists')
logger.info(f"file_doc exists")
doc = file.read_json(file_doc)
if doc["meta"]["flow-pdf-version"] == version:
logger.info(f'file_doc version is same, skip')
logger.info(f"file_doc version is same, skip")
continue
else:
logger.info(f'clean old version {doc["meta"]["flow-pdf-version"]}')
shutil.rmtree(dir_output / stem)

file_input = dir_input / f'{stem}.pdf'
file_input = dir_input / f"{stem}.pdf"

logger.info(f"start {file_input.name}")

Expand All @@ -110,6 +111,7 @@
},
)

logger.error(f"{file_input.name} error, {e}")
logger.error(f"{file_input.name} error")
traceback.print_exc()

logger.info(f"end {file_input.name}")

0 comments on commit af06e22

Please sign in to comment.