Skip to content

Commit

Permalink
add tts and stt consumers threads
Browse files Browse the repository at this point in the history
  • Loading branch information
elizaveta-andreeva committed May 29, 2024
1 parent 991b161 commit 5a08cbd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
)

import my_cron
import kafka.kafka_consumer
import kafka.consumer_tts
import kafka.consumer_stt

from logs import init_logger

Expand Down Expand Up @@ -90,14 +91,16 @@ def process(token_):
auth_in_db(username=sys.argv[2], password=sys.argv[3])
if token_ == 'bot':
main(sys.argv[1])
elif token_ == 'kafka':
kafka.kafka_consumer.main()
elif token_ == 'kafka-tts':
kafka.consumer_tts.main()
elif token_ == 'kafka-stt':
kafka.consumer_stt.main()
else:
my_cron.main(sys.argv[1])


if __name__ == '__main__':
tokens = ['bot', 'schedule', 'kafka']
tokens = ['bot', 'schedule', 'kafka-tts', 'kafka-stt']
work_queue = queue.Queue()
for token in tokens:
work_queue.put(token)
Expand Down

0 comments on commit 5a08cbd

Please sign in to comment.