mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-06 20:01:37 +08:00
optimize(web): program cleanup on exit
This commit is contained in:
parent
0f36233017
commit
bd0b43f7e6
@ -1639,6 +1639,14 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|||||||
gr.Markdown(traceback.format_exc())
|
gr.Markdown(traceback.format_exc())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import signal
|
||||||
|
def cleanup(signum, frame):
|
||||||
|
signame = signal.Signals(signum).name
|
||||||
|
print(f'Got signal {signame} ({signum})')
|
||||||
|
app.close()
|
||||||
|
sys.exit(0)
|
||||||
|
signal.signal(signal.SIGINT, cleanup)
|
||||||
|
signal.signal(signal.SIGTERM, cleanup)
|
||||||
if config.iscolab:
|
if config.iscolab:
|
||||||
app.queue(max_size=1022).launch(share=True, max_threads=511)
|
app.queue(max_size=1022).launch(share=True, max_threads=511)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user