MCPcopy
hub / github.com/benoitc/gunicorn / cached_query

Function cached_query

examples/celery_alternative/app.py:327–339  ·  view source on GitHub ↗

Execute a cached query.

(data: QueryRequest)

Source from the content-addressed store, hash-verified

325
326@app.post("/api/data/query")
327async def cached_query(data: QueryRequest):
328 """Execute a cached query."""
329 try:
330 client = await get_dirty_client_async()
331 result = await client.execute_async(
332 DATA_WORKER,
333 "cached_query",
334 query_key=data.query_key,
335 ttl=data.ttl,
336 )
337 return result
338 except DirtyError as e:
339 raise HTTPException(status_code=500, detail=str(e))
340
341
342@app.get("/api/data/stats")

Callers

nothing calls this directly

Calls 2

get_dirty_client_asyncFunction · 0.90
execute_asyncMethod · 0.80

Tested by

no test coverage detected