TTS icon indicating copy to clipboard operation
TTS copied to clipboard

Fixes a race condition with multiple simultaneous get requests.

Open KyuubiYoru opened this issue 2 years ago β€’ 5 comments

This fixes an issue where, if you make multiple requests at the same time, the results will sound corrupted or you will get an internal server error.

KyuubiYoru avatar Jul 31 '22 09:07 KyuubiYoru

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 31 '22 09:07 CLAassistant

Thanks for ✨PR✨

I see there are style issues. If you fix, I can merge this PR

erogol avatar Aug 01 '22 09:08 erogol

I'm not sure how i can fix this error. TTS/server/server.py:174:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) i'm doing lock.acquire() in this line.

KyuubiYoru avatar Aug 01 '22 11:08 KyuubiYoru

I'm not sure how i can fix this error. TTS/server/server.py:174:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) i'm doing lock.acquire() in this line.

I think the formatter prefers the with notation:

lock = Lock()
@app.route("/api/tts", methods=["GET"])
def tts():
    with lock:
        text = request.args.get("text")
        ...

rather than that:

lock = Lock()
@app.route("/api/tts", methods=["GET"])
def tts():
    lock.acquire()
    text = request.args.get("text")
    ...
    lock.release()

WeberJulian avatar Aug 04 '22 12:08 WeberJulian

Reformatted the file i changed failed this time?

black tests TTS notebooks recipes --check
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install black[jupyter]``
would reformat TTS/server/server.py

Oh no! πŸ’₯ πŸ’” πŸ’₯
1 file would be reformatted, 298 files would be left unchanged.
make: *** [Makefile:47: lint] Error 1
Error: Process completed with exit code 2.

KyuubiYoru avatar Aug 07 '22 05:08 KyuubiYoru

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

stale[bot] avatar Sep 06 '22 10:09 stale[bot]