余尚辉 3 ヶ月 前
コミット
7f68d5a211

+ 1 - 1
Dockerfile

@@ -13,7 +13,7 @@ RUN cd /code/pjproject/pjsip-apps/src/swig/python && make && make install
 # pyESL
 RUN cd /code/python-ESL-1.4.18 && python setup.py install
 # nls
-RUN cd /code/alibabacloud-nls-python-sdk-dev && python -m pip install . -r requirements.txt --no-cache-dir
+RUN cd /code/alibabacloud-nls-python-sdk-dev && python -m pip install -r requirements.txt && python -m pip install .
 # 安装项目依赖
 RUN pip install -r requirements.txt
 

+ 4 - 1
alibabacloud-nls-python-sdk-dev/nls/websocket/_app.py

@@ -173,6 +173,7 @@ class WebSocketApp:
         self.last_pong_tm = 0
         self.subprotocols = subprotocols
         self.callback_args = callback_args
+        self.has_teardown = False
 
     def update_args(self, *args):
         self.callback_args = args
@@ -293,7 +294,9 @@ class WebSocketApp:
                 If close_frame is set, the on_close handler is invoked
                 with the statusCode and reason from the provided frame.
             """
-
+            if self.has_teardown:
+                return
+            self.has_teardown = True
             if thread and thread.is_alive():
                 event.set()
                 thread.join()

+ 1 - 1
alibabacloud-nls-python-sdk-dev/tests/test_tts.py

@@ -47,7 +47,7 @@ class TestTts:
         tts = nls.NlsSpeechSynthesizer(
                     token=TEST_ACCESS_TOKEN,
                     appkey=TEST_ACCESS_APPKEY,
-                    long_tts=True,
+                    long_tts=False,
                     on_metainfo=self.test_on_metainfo,
                     on_data=self.test_on_data,
                     on_completed=self.test_on_completed,