Add process manager to the right place

This commit is contained in:
henryruhs
2026-01-19 11:38:06 +01:00
parent 3575aeea86
commit dc500eb398
2 changed files with 5 additions and 2 deletions
+5 -1
View File
@@ -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
-1
View File
@@ -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',