Fix: a bug that prevented speech synthesis in app.py

This commit is contained in:
tsukumi
2024-03-08 22:09:47 +00:00
parent 30ea08d6ea
commit d22a11ebb2
5 changed files with 46 additions and 5 deletions

View File

@@ -105,7 +105,12 @@ def initialize(port: int = WORKER_PORT) -> None:
def signal_handler(signum: int, frame: Any):
terminate()
signal.signal(signal.SIGTERM, signal_handler)
try:
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
except ValueError:
# signal only works in main thread
pass
# top-level declaration