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
1c3675c2
authored
2025-02-13 14:03:05 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'hotfix/2025-02' into feature/uat-tmp
2 parents
f9d91879
9034ef22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
1c3675c
...
...
@@ -3775,7 +3775,10 @@ 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_")
pool
.
submit
(
fsm_compare_thread
,
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
)
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
()))
#pool.shutdown(wait=True)
...
...
@@ -3785,10 +3788,14 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
is_ca
,
is_cms
))
# 查看此订单号下是否有未完成的文件,如果有,等1分钟
doc_wait_file_class
=
HILDoc
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCDoc
doc_wait_file_result
=
doc_wait_file_class
.
objects
.
filter
(
application_id
=
application_id
,
status
=
1
)
.
first
()
compare_log
.
info
(
'doc_wait_file_result:{0}'
.
format
(
doc_wait_file_result
))
compare_log
.
info
(
'{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
))
try
:
doc_wait_file_class
=
HILDoc
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCDoc
doc_wait_file_result
=
doc_wait_file_class
.
objects
.
filter
(
application_id
=
application_id
,
status
=
1
)
.
first
()
compare_log
.
info
(
'doc_wait_file_result:{0}'
.
format
(
doc_wait_file_result
))
compare_log
.
info
(
'{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
))
except
Exception
as
e
:
doc_wait_file_result
=
None
compare_log
.
info
(
'[get doc_wait_file_result fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
if
doc_wait_file_result
is
not
None
:
# 实时查询延迟时间
try
:
...
...
@@ -3853,7 +3860,10 @@ 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_")
pool
.
submit
(
compare_thread
,
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
)
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
()))
#pool.shutdown(wait=True)
def
compare_thread
(
application_id
,
application_entity
,
uniq_seq
,
ocr_res_id
,
is_ca
=
True
,
is_cms
=
False
):
...
...
@@ -3903,10 +3913,14 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
return
# 查看此订单号下是否有未完成的文件,如果有,等?分钟
doc_wait_file_class
=
HILDoc
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCDoc
doc_wait_file_result
=
doc_wait_file_class
.
objects
.
filter
(
application_id
=
application_id
,
status
=
1
)
.
first
()
compare_log
.
info
(
'doc_wait_file_result:{0}'
.
format
(
doc_wait_file_result
))
compare_log
.
info
(
'{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
))
try
:
doc_wait_file_class
=
HILDoc
if
application_entity
==
consts
.
HIL_PREFIX
else
AFCDoc
doc_wait_file_result
=
doc_wait_file_class
.
objects
.
filter
(
application_id
=
application_id
,
status
=
1
)
.
first
()
compare_log
.
info
(
'doc_wait_file_result:{0}'
.
format
(
doc_wait_file_result
))
compare_log
.
info
(
'{0} [comparison unfinished file check] [entity={1}] [id={2}] [doc_wait_file_result={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
))
except
Exception
as
e
:
doc_wait_file_result
=
None
compare_log
.
info
(
'[get doc_wait_file_result fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
if
doc_wait_file_result
is
not
None
:
# 实时查询延迟时间
try
:
...
...
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