fix(latency): threadpool renders + RENDER_LOCK + client pre-render cache

This commit is contained in:
2026-08-16 20:21:48 +07:00
parent 90b5a63719
commit ed26e1706d
6 changed files with 139 additions and 42 deletions
+3 -2
View File
@@ -6,7 +6,7 @@ from fastapi.responses import FileResponse
from pydantic import BaseModel
from typing import Optional, Any
from app.config import settings
from app.core.vst_engine import PluginManager, HAS_PEDALBOARD, HAS_PYFLUIDSYNTH, apply_preset_to_plugin, render_soundfont_midi_to_audio
from app.core.vst_engine import PluginManager, HAS_PEDALBOARD, HAS_PYFLUIDSYNTH, apply_preset_to_plugin, render_soundfont_midi_to_audio, RENDER_LOCK, _render_locked
from app.core.render_engine import PythonRenderEngine, _find_sf2_path, _find_default_sf2
from app.core.soundfont_inspector import SoundFontInspector
from app.core.soundfont_converter import SoundFontConverter
@@ -975,6 +975,7 @@ async def midi_render(req: MidiRenderRequest, current_user: dict = Depends(get_c
)
@_render_locked
def _render_midi_notes_pedalboard(instrument_id: str, notes: list, bpm: float,
sample_rate: int, preset_id=None, preset_path=None,
preset_data_b64=None, soundfont_bank=None,
@@ -1162,7 +1163,7 @@ def _carla_bridge_running() -> bool:
@router.post("/render")
async def render_project(
def render_project(
req: RenderRequest,
current_user: dict = Depends(get_current_user)
):