feat: align frontend runtime and Edge TTS
This commit is contained in:
+17
-1
@@ -19,4 +19,20 @@ runtime_config=$(jq -cn \
|
||||
|
||||
printf 'globalThis.__TJWATER_CONFIG__ = %s;\n' "$runtime_config" > /srv/runtime-config.js
|
||||
|
||||
exec "$@"
|
||||
node /usr/local/lib/tjwater-frontend/edge-tts-server.cjs &
|
||||
tts_pid=$!
|
||||
|
||||
"$@" &
|
||||
app_pid=$!
|
||||
|
||||
terminate() {
|
||||
kill "$app_pid" "$tts_pid" 2>/dev/null || true
|
||||
}
|
||||
trap terminate INT TERM
|
||||
|
||||
status=0
|
||||
wait -n "$app_pid" "$tts_pid" || status=$?
|
||||
terminate
|
||||
wait "$app_pid" 2>/dev/null || true
|
||||
wait "$tts_pid" 2>/dev/null || true
|
||||
exit "$status"
|
||||
|
||||
Reference in New Issue
Block a user