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 b64534b5
authored
Mar 21, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]数据库连接池优化
1 parent
f0ace46f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
funasr_service.py
funasr_service.py
View file @
b64534b
...
@@ -77,23 +77,23 @@ def deal_worker(task_id: str):
...
@@ -77,23 +77,23 @@ def deal_worker(task_id: str):
要执行的函数,在子进程中运行
要执行的函数,在子进程中运行
"""
"""
try
:
try
:
res
=
funasr_db
.
select_ali_asr_model_res
(
task_id
)
sql_
res
=
funasr_db
.
select_ali_asr_model_res
(
task_id
)
if
res
is
None
or
isinstance
(
res
,
bool
)
or
len
(
res
)
<
1
:
if
sql_res
is
None
or
isinstance
(
sql_res
,
bool
)
or
len
(
sql_
res
)
<
1
:
return
return
output_data
=
json
.
loads
(
res
)
[
0
][
"output_data"
]
output_data
=
sql_res
[
0
][
"output_data"
]
if
output_data
is
not
None
:
if
output_data
is
not
None
:
return
return
url
=
json
.
loads
(
res
)
[
0
][
"file_url"
]
url
=
sql_res
[
0
][
"file_url"
]
log
.
info
(
f
"Worker {task_id} is running... url:{url}"
)
log
.
info
(
f
"Worker {task_id} is running... url:{url}"
)
consuming_start_time
=
time
.
perf_counter
()
consuming_start_time
=
time
.
perf_counter
()
# 解析音频
# 解析音频
res
=
FunasrService
(
url
)
.
transform
()
output_
res
=
FunasrService
(
url
)
.
transform
()
if
len
(
res
)
<
1
:
if
len
(
output_
res
)
<
1
:
log
.
info
(
"
res:
%
s"
%
res
)
log
.
info
(
"
output_res:
%
s"
%
output_
res
)
funasr_db
.
update_ali_asr_model_res
(
task_id
,
res
,
0
)
funasr_db
.
update_ali_asr_model_res
(
task_id
,
output_
res
,
0
)
return
return
sentence_info
=
res
[
0
][
"sentence_info"
]
sentence_info
=
output_
res
[
0
][
"sentence_info"
]
log
.
info
(
"res.sentence_info:
%
s"
%
sentence_info
)
log
.
info
(
"
output_
res.sentence_info:
%
s"
%
sentence_info
)
output
=
[]
output
=
[]
content
=
""
content
=
""
spk
=
0
spk
=
0
...
...
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