mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 09:35:53 +08:00
Let task continue dispaching while meeting unexpected doc formats (#199)
### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ Issue link:#[[Link the issue here](https://github.com/infiniflow/ragflow/issues/198)] ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Breaking Change (fix or feature that could cause existing functionality not to work as expected) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Test cases - [ ] Python SDK impacted, Need to update PyPI - [ ] Other (please describe):
This commit is contained in:
parent
36f2d7b797
commit
572e5b1ff1
@ -73,7 +73,7 @@ def dispatch():
|
|||||||
for t in tsks:
|
for t in tsks:
|
||||||
TaskService.delete_by_id(t.id)
|
TaskService.delete_by_id(t.id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
cron_logger.error("delete task exception:" + str(e))
|
cron_logger.exception(e)
|
||||||
|
|
||||||
def new_task():
|
def new_task():
|
||||||
nonlocal r
|
nonlocal r
|
||||||
@ -83,6 +83,7 @@ def dispatch():
|
|||||||
}
|
}
|
||||||
|
|
||||||
tsks = []
|
tsks = []
|
||||||
|
try:
|
||||||
if r["type"] == FileType.PDF.value:
|
if r["type"] == FileType.PDF.value:
|
||||||
do_layout = r["parser_config"].get("layout_recognize", True)
|
do_layout = r["parser_config"].get("layout_recognize", True)
|
||||||
pages = PdfParser.total_page_number(
|
pages = PdfParser.total_page_number(
|
||||||
@ -121,6 +122,9 @@ def dispatch():
|
|||||||
|
|
||||||
bulk_insert_into_db(Task, tsks, True)
|
bulk_insert_into_db(Task, tsks, True)
|
||||||
set_dispatching(r["id"])
|
set_dispatching(r["id"])
|
||||||
|
except Exception as e:
|
||||||
|
cron_logger.exception(e)
|
||||||
|
|
||||||
tmf.write(str(r["update_time"]) + "\n")
|
tmf.write(str(r["update_time"]) + "\n")
|
||||||
tmf.close()
|
tmf.close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user