You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
390 B

import { getCache, setCache } from "#server/utils/context";
import { listTools } from "../../service/tool";
export default defineWrappedResponseHandler(async () => {
const cacheKey = "tools:list";
const cached = await getCache(cacheKey);
if (cached) return R.success(cached);
const tools = await listTools();
await setCache(cacheKey, tools, 300);
return R.success(tools);
});