tomoya 7 月之前
父節點
當前提交
d1766f0e33
共有 1 個文件被更改,包括 2 次插入1 次删除
  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):