fix task_service.py (#8687)
Fix the case where pages variable might be None ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
1e6bda735a
commit
ae3683c346
1 changed files with 2 additions and 0 deletions
|
|
@ -338,6 +338,8 @@ def queue_tasks(doc: dict, bucket: str, name: str, priority: int):
|
|||
file_bin = STORAGE_IMPL.get(bucket, name)
|
||||
do_layout = doc["parser_config"].get("layout_recognize", "DeepDOC")
|
||||
pages = PdfParser.total_page_number(doc["name"], file_bin)
|
||||
if pages is None:
|
||||
pages = 0
|
||||
page_size = doc["parser_config"].get("task_page_size") or 12
|
||||
if doc["parser_id"] == "paper":
|
||||
page_size = doc["parser_config"].get("task_page_size") or 22
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue