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 3376056c
authored
Mar 25, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]配置优化
1 parent
221c0ed2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
kafka_service/test01.py
utils/ap_scheduler_util.py
kafka_service/test01.py
View file @
3376056
from
kafka
import
KafkaConsumer
from
kafka
import
KafkaConsumer
import
funasr_service
# 创建Kafka消费者
# 创建Kafka消费者
consumer
=
KafkaConsumer
(
#
consumer = KafkaConsumer(
"my-yang-topic"
,
# Kafka主题名称
#
"my-yang-topic", # Kafka主题名称
bootstrap_servers
=
"192.168.3.131:9092"
,
# Kafka集群的地址
#
bootstrap_servers="192.168.3.131:9092", # Kafka集群的地址
group_id
=
"my-yang-group"
,
# 消费者组ID
#
group_id="my-yang-group", # 消费者组ID
)
#
)
# 循环消费消息
# 循环消费消息
# for message in consumer:
# for message in consumer:
...
@@ -14,11 +15,7 @@ consumer = KafkaConsumer(
...
@@ -14,11 +15,7 @@ consumer = KafkaConsumer(
# value = message.value
# value = message.value
# print(f"Key: {key}, Value: {value}")
# print(f"Key: {key}, Value: {value}")
datas
=
[
'0f4ba9a0-e7f6-11ee-b77c-b083fec01e48'
]
datas
=
[
""
,
" "
,
"1111"
,
"https"
,
"1http"
,]
for
task_id
in
datas
:
for
data
in
datas
:
funasr_service
.
deal_worker
(
task_id
)
data
.
replace
(
" "
,
""
)
if
data
==
""
or
len
(
data
)
<
1
or
not
data
.
startswith
(
"http"
):
print
(
False
)
else
:
print
(
True
)
utils/ap_scheduler_util.py
View file @
3376056
...
@@ -3,7 +3,6 @@ import time
...
@@ -3,7 +3,6 @@ import time
import
funasr_service
import
funasr_service
from
apscheduler.schedulers.blocking
import
BlockingScheduler
from
apscheduler.schedulers.blocking
import
BlockingScheduler
from
apscheduler.schedulers.background
import
BackgroundScheduler
from
apscheduler.schedulers.background
import
BackgroundScheduler
from
apscheduler.jobstores.mongodb
import
MongoDBJobStore
from
apscheduler.jobstores.memory
import
MemoryJobStore
from
apscheduler.jobstores.memory
import
MemoryJobStore
from
apscheduler.executors.pool
import
ThreadPoolExecutor
,
ProcessPoolExecutor
from
apscheduler.executors.pool
import
ThreadPoolExecutor
,
ProcessPoolExecutor
from
log.logger
import
log
from
log.logger
import
log
...
...
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