Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
funasr_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5db69d63
authored
Mar 22, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]异常日志优化
1 parent
f4bb99cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
funasr_service.py
mysql_service/funasr_db.py
funasr_service.py
View file @
5db69d6
...
...
@@ -109,7 +109,7 @@ def deal_worker(task_id: str):
)
log
.
info
(
f
"Worker {task_id} finished."
)
except
Exception
as
e
:
funasr_db
.
update_ali_asr_model_res_fail
(
task_id
,
traceback
.
format_exc
())
funasr_db
.
update_ali_asr_model_res_fail
(
task_id
,
str
(
e
),
traceback
.
format_exc
())
log
.
error
(
f
"Worker error{e}"
)
traceback
.
print_exc
()
return
{
"Worker error"
:
str
(
e
)}
...
...
mysql_service/funasr_db.py
View file @
5db69d6
...
...
@@ -33,11 +33,12 @@ def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int):
return
pool
.
update_one
(
update_sql
,
(
json_output
,
execute_time
,
task_id
,))
def
update_ali_asr_model_res_fail
(
task_id
:
str
,
exception
:
str
):
def
update_ali_asr_model_res_fail
(
task_id
:
str
,
exception
_msg
:
str
,
exception
:
str
):
update_sql
=
(
f
"update ali_asr_model_res t set t.task_status = 2, t.exception_log =
%
s,exception_limit = exception_limit + 1 "
f
"update ali_asr_model_res t set t.task_status = 2, t.exception_msg =
%
s, t.exception_log =
%
s, "
f
"exception_limit = exception_limit + 1 "
f
"where t.task_id =
%
s;"
)
return
pool
.
update_one
(
update_sql
,
(
exception
,
task_id
,))
return
pool
.
update_one
(
update_sql
,
(
exception
_msg
,
exception
,
task_id
,))
def
select_ali_asr_model_res
(
task_id
:
str
):
...
...
Write
Preview
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