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
c7cdc7fa
authored
2025-01-10 12:42:37 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
MOD:try exception
1 parent
f6883dc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
c7cdc7f
...
...
@@ -3668,11 +3668,16 @@ def se_compare(application_id, application_entity, ocr_res_id, last_obj, ocr_res
try
:
compare_log
.
info
(
'{0} [SE] [cms sleep start] [entity={1}] [id={2}] '
.
format
(
log_base
,
application_entity
,
application_id
))
# 实时查询延迟时间
cms_delay_time_config
=
Configs
.
objects
.
filter
(
id
=
5
)
.
first
()
if
cms_delay_time_config
is
not
None
and
cms_delay_time_config
.
value
is
not
None
and
cms_delay_time_config
.
value
.
isdigit
():
cms_delay_time
=
cms_delay_time_config
.
value
else
:
try
:
cms_delay_time_config
=
Configs
.
objects
.
filter
(
id
=
5
)
.
first
()
if
cms_delay_time_config
is
not
None
and
cms_delay_time_config
.
value
is
not
None
and
cms_delay_time_config
.
value
.
isdigit
():
cms_delay_time
=
cms_delay_time_config
.
value
else
:
cms_delay_time
=
0
except
Exception
as
e
:
cms_delay_time
=
0
compare_log
.
info
(
'[get cms_delay_time_config fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
compare_log
.
info
(
'cms_delay_time:{0}'
.
format
(
cms_delay_time
))
time
.
sleep
(
int
(
cms_delay_time
))
compare_log
.
info
(
'{0} [SE] [cms sleep end] [entity={1}] [id={2}] '
.
format
(
log_base
,
application_entity
,
application_id
))
...
...
@@ -3716,20 +3721,23 @@ def fsm_compare_thread(application_id, application_entity, uniq_seq, ocr_res_id,
'[is_cms={6}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
,
is_ca
,
is_cms
))
# 实时查询延迟时间
delay_time_config
=
Configs
.
objects
.
filter
(
id
=
4
)
.
first
()
if
delay_time_config
is
not
None
and
delay_time_config
.
value
is
not
None
and
delay_time_config
.
value
.
isdigit
():
delay_time
=
delay_time_config
.
value
else
:
delay_time
=
0
compare_log
.
info
(
'delay_time:{0}'
.
format
(
delay_time
))
# 查看此订单号下是否有未完成的文件,如果有,等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
))
if
doc_wait_file_result
is
not
None
:
# 实时查询延迟时间
try
:
delay_time_config
=
Configs
.
objects
.
filter
(
id
=
4
)
.
first
()
if
delay_time_config
is
not
None
and
delay_time_config
.
value
is
not
None
and
delay_time_config
.
value
.
isdigit
():
delay_time
=
delay_time_config
.
value
else
:
delay_time
=
0
except
Exception
as
e
:
delay_time
=
0
compare_log
.
info
(
'[get delay_time_config fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
compare_log
.
info
(
'delay_time:{0}'
.
format
(
delay_time
))
compare_log
.
info
(
'{0} [comparison unfinished file wait delay_time start] [entity={1}] [id={2}] [doc_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
.
id
))
time
.
sleep
(
int
(
delay_time
))
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
))
...
...
@@ -3777,20 +3785,24 @@ def compare_thread(application_id, application_entity, uniq_seq, ocr_res_id, is_
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
))
# 实时查询延迟时间
delay_time_config
=
Configs
.
objects
.
filter
(
id
=
4
)
.
first
()
if
delay_time_config
is
not
None
and
delay_time_config
.
value
is
not
None
and
delay_time_config
.
value
.
isdigit
():
delay_time
=
delay_time_config
.
value
else
:
delay_time
=
0
compare_log
.
info
(
'delay_time:{0}'
.
format
(
delay_time
))
# 查看此订单号下是否有未完成的文件,如果有,等
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
))
if
doc_wait_file_result
is
not
None
:
# 实时查询延迟时间
try
:
delay_time_config
=
Configs
.
objects
.
filter
(
id
=
4
)
.
first
()
if
delay_time_config
is
not
None
and
delay_time_config
.
value
is
not
None
and
delay_time_config
.
value
.
isdigit
():
delay_time
=
delay_time_config
.
value
else
:
delay_time
=
0
except
Exception
as
e
:
delay_time
=
0
compare_log
.
info
(
'[get delay_time_config fail] [error={0}]'
.
format
(
traceback
.
format_exc
()))
compare_log
.
info
(
'delay_time:{0}'
.
format
(
delay_time
))
compare_log
.
info
(
'{0} [comparison unfinished file wait delay_time start] [entity={1}] [id={2}] [doc_id={3}]'
.
format
(
log_base
,
application_entity
,
application_id
,
doc_wait_file_result
.
id
))
time
.
sleep
(
int
(
delay_time
))
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
))
...
...
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