tomoya hace 7 meses
padre
commit
d1766f0e33
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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,
             add_sampling_metadata=True,
             api_name="/generate"
             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")
 @router.websocket("/sr")
 async def websocket_endpoint(websocket: WebSocket):
 async def websocket_endpoint(websocket: WebSocket):