MCPcopy Create free account
hub / github.com/LangGraph-GUI/LangGraph-GUI-backend / clean_cache

Function clean_cache

src/FileTransmit.py:84–100  ·  view source on GitHub ↗
(username: str)

Source from the content-addressed store, hash-verified

82# Route to handle cleaning the user's workspace
83@file_router.post('/clean-cache/{username}')
84async def clean_cache(username: str):
85 try:
86 # Get or create the user's workspace
87 user_workspace = get_or_create_workspace(username)
88
89 # Delete all files in the user's workspace
90 for root, dirs, files in os.walk(user_workspace):
91 for file in files:
92 file_path = os.path.join(root, file)
93 os.remove(file_path)
94 print(f"Deleted file: {file_path}")
95
96 return JSONResponse(content={"message": "Workspace successfully cleaned"}, status_code=200)
97
98 except Exception as e:
99 print(f"Error cleaning workspace: {e}")
100 raise HTTPException(status_code=500, detail=f"Failed to clean workspace: {str(e)}")

Callers

nothing calls this directly

Calls 1

get_or_create_workspaceFunction · 0.85

Tested by

no test coverage detected