Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
775d6ee5
authored
2025-02-13 14:34:10 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ADD:try catch
1 parent
9034ef22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
775d6ee
...
...
@@ -3732,6 +3732,7 @@ def fsm_compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=
compare_log
.
info
(
'[fsm thread]'
)
#pool = ThreadPoolExecutor(max_workers=6, thread_name_prefix="fsm_thread_")
try
:
# 这个try不生效
pool
.
submit
(
fsm_compare_thread
,
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
)
except
Exception
as
e
:
compare_log
.
info
(
'[fsm thread fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
...
...
@@ -3739,6 +3740,7 @@ def fsm_compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=
def
fsm_compare_thread
(
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
=
True
,
is_cms
=
False
):
try
:
compare_log
.
info
(
'{0} [receive fsm task] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}] [is_ca={5}] '
'[is_cms={6}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
))
...
...
@@ -3770,6 +3772,8 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
except
Exception
as
e
:
compare_log
.
info
(
'[sleep error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
compare_log
.
info
(
'{0} [comparison unfinished file wait delay_time end] [entity={1}] [id={2}] [doc_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
.
id
))
except
Exception
as
e
:
compare_log
.
info
(
'[fsm_compare_thread error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
# 调用java fsm 比对流程接口(http)
...
...
@@ -3817,6 +3821,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True
compare_log
.
info
(
'[non fsm thread]'
)
#pool = ThreadPoolExecutor(max_workers=6, thread_name_prefix="non_fsm_thread_")
try
:
# 这个try不生效
pool
.
submit
(
compare_thread
,
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
)
except
Exception
as
e
:
compare_log
.
info
(
'[non fsm thread fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
...
...
@@ -3825,7 +3830,7 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id, is_ca=True
def
compare_thread
(
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
=
True
,
is_cms
=
False
):
# POS: application_id, application_entity, uniq_seq, None
# OCR: application_id, business_type(application_entity), None, ocr_res_id
try
:
compare_log
.
info
(
'{0} [receive task] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}] [is_ca={5}] '
'[is_cms={6}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
))
...
...
@@ -3941,4 +3946,5 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
compare_log
.
error
(
'{0} [Auto SE] [result save error] [entity={1}] [id={2}] [ocr_res_id={3}] '
'[error={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
ocr_res_id
,
traceback
.
format_exc
()))
except
Exception
as
e
:
compare_log
.
info
(
'[compare_thread error] [error={0}]'
.
format
(
traceback
.
format_exc
()))
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment