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
5218f898
authored
2024-01-30 14:28:26 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
initial
1 parent
d915554f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/management/commands/ocr_process.py
View file @
5218f89
...
...
@@ -2037,6 +2037,7 @@ class Command(BaseCommand, LoggerMixin):
result_class
=
AFCOCRResult
if
is_ca
else
AFCSEOCRResult
res_obj
=
result_class
.
objects
.
select_for_update
()
.
filter
(
application_id
=
doc
.
application_id
)
.
first
()
with
transaction
.
atomic
():
self
.
online_log
.
info
(
'{0} [sql lock application_id={1}]'
.
format
(
self
.
log_base
,
doc
.
application_id
))
if
res_obj
is
None
:
res_obj
=
result_class
()
res_obj
.
application_id
=
doc
.
application_id
...
...
@@ -2061,6 +2062,7 @@ class Command(BaseCommand, LoggerMixin):
last_res_str
=
json
.
dumps
(
old_res_list
)
setattr
(
res_obj
,
field
,
last_res_str
)
res_obj
.
save
()
self
.
online_log
.
info
(
'{0} [sql lock release application_id={1}]'
.
format
(
self
.
log_base
,
doc
.
application_id
))
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (ocr result save)] [task={1}] [error={2}]'
.
format
(
...
...
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