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
76581bb1
authored
2021-04-07 17:22:23 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add delay GCAP
1 parent
381cf7e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
src/celery_compare/tasks.py
src/celery_compare/tasks.py
View file @
76581bb
import
json
import
time
import
logging
import
traceback
from
datetime
import
datetime
,
timedelta
from
collections
import
OrderedDict
from
.
import
app
from
apps.doc.models
import
AFCOCRResult
,
HILOCRResult
,
AFCComparisonInfo
,
HILComparisonInfo
...
...
@@ -157,6 +159,13 @@ def compare(application_id, application_entity, uniq_seq, ocr_res_id):
'[compare_res={5}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
,
comparison_res
))
# 时间延迟
send_time
=
last_obj
.
create_time
+
timedelta
(
seconds
=
15
)
while
datetime
.
now
()
<
send_time
:
compare_log
.
info
(
'{0} [time wait 5s] [entity={1}] [id={2}] [uniq_seq={3}] [ocr_res_id={4}]'
.
format
(
log_base
,
application_entity
,
application_id
,
uniq_seq
,
ocr_res_id
))
time
.
sleep
(
5
)
# 将比对结果发送GCAP
try
:
data
=
gcap
.
dict_to_xml
(
comparison_res
)
...
...
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