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
b39c34cf
authored
2021-03-24 19:36:23 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add log
1 parent
1bd26cf0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/management/commands/ocr_process.py
View file @
b39c34c
...
...
@@ -910,13 +910,16 @@ class Command(BaseCommand, LoggerMixin):
old_res_str
=
getattr
(
res_obj
,
field
)
if
old_res_str
is
None
:
last_res_str
=
json
.
dumps
(
license_list
)
else
else
:
old_res_list
=
json
.
loads
(
old_res_str
)
old_res_list
.
extend
(
license_list
)
last_res_str
=
json
.
dumps
(
old_res_list
)
setattr
(
res_obj
,
field
,
last_res_str
)
res_obj
.
save
()
self
.
online_log
.
info
(
'{0} [ocr result save success] [task={1}] [res_id={2}]'
.
format
(
self
.
log_base
,
task_str
,
res_obj
.
id
))
# 触发比对
# compare.apply_async((doc.application_id, business_type, None, ocr_res_id), queue='queue_compare')
finally
:
...
...
@@ -926,6 +929,7 @@ class Command(BaseCommand, LoggerMixin):
shutil
.
rmtree
(
img_save_path
,
ignore_errors
=
True
)
pdf_path
=
os
.
path
.
join
(
doc_data_path
,
'{0}.pdf'
.
format
(
doc_id_str
))
os
.
remove
(
pdf_path
)
self
.
online_log
.
info
(
'{0} [pdf & img remove] [task={1}]'
.
format
(
self
.
log_base
,
task_str
))
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (pdf & img remove)] [task={1}] [error={2}]'
.
format
(
self
.
log_base
,
task_str
,
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