tomoya il y a 7 mois
Parent
commit
d1766f0e33
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      backend/app/app/api/api_v1/endpoints/images.py

+ 2 - 1
backend/app/app/api/api_v1/endpoints/images.py

@@ -156,7 +156,8 @@ def get_image(
             add_sampling_metadata=True,
             api_name="/generate"
     )   
-    return FileResponse(result, background=background_tasks(remove_file, result))
+    background_tasks.add_task(remove_file, result)
+    return FileResponse(result, background=background_tasks)
 
 @router.websocket("/sr")
 async def websocket_endpoint(websocket: WebSocket):