From dc500eb39837fbf85cc649001b5d228e710a1865 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Mon, 19 Jan 2026 11:38:06 +0100 Subject: [PATCH] Add process manager to the right place --- facefusion/apis/endpoints/assets.py | 6 +++++- tests/test_api_assets.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/facefusion/apis/endpoints/assets.py b/facefusion/apis/endpoints/assets.py index 902a8183..55687699 100644 --- a/facefusion/apis/endpoints/assets.py +++ b/facefusion/apis/endpoints/assets.py @@ -7,7 +7,7 @@ from starlette.requests import Request from starlette.responses import JSONResponse, Response from starlette.status import HTTP_201_CREATED, HTTP_400_BAD_REQUEST -from facefusion import ffmpeg, session_manager, state_manager +from facefusion import ffmpeg, process_manager, session_manager, state_manager from facefusion.apis import asset_store from facefusion.apis.asset_helper import detect_media_type from facefusion.apis.endpoints.session import extract_access_token @@ -60,6 +60,8 @@ async def save_asset_files(upload_files : List[UploadFile]) -> List[str]: temp_path = state_manager.get_temp_path() asset_path = os.path.join(temp_path, temp_file.name + '.' + upload_file_extension) + process_manager.start() + if media_type == 'audio' and ffmpeg.sanitize_audio(temp_file.name, asset_path): asset_paths.append(asset_path) @@ -69,6 +71,8 @@ async def save_asset_files(upload_files : List[UploadFile]) -> List[str]: if media_type == 'video' and ffmpeg.sanitize_video(temp_file.name, asset_path): asset_paths.append(asset_path) + process_manager.end() + remove_file(temp_file.name) return asset_paths diff --git a/tests/test_api_assets.py b/tests/test_api_assets.py index ea5a42db..5b5fe259 100644 --- a/tests/test_api_assets.py +++ b/tests/test_api_assets.py @@ -13,7 +13,6 @@ from .helper import get_test_example_file, get_test_examples_directory @pytest.fixture(scope = 'module', autouse = True) def before_all() -> None: - process_manager.start() conditional_download(get_test_examples_directory(), [ 'https://github.com/facefusion/facefusion-assets/releases/download/examples-3.0.0/source.jpg',