Skip to content

Commit

Permalink
add simplified test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirving committed Aug 29, 2024
1 parent 58c1df9 commit 088d4b7
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@
query_router = APIRouter()


@query_router.get("/v1/test-thing")
def test_thing() -> StreamingResponse:
return StreamingResponse(

Check warning on line 67 in python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py#L67

Added line #L67 was not covered by tests
_whatever(),
media_type="application/jsonlines",
headers={
# Instruct the Kubernetes ingress to not buffer the response,
# so that keep-alives reach the client promptly.
"X-Accel-Buffering": "no"
},
)


async def _whatever() -> AsyncIterator:
while True:
await asyncio.sleep(1)
yield '{ "type": "keep-alive" }\n'

Check warning on line 81 in python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/remote_butler/server/handlers/_external_query.py#L79-L81

Added lines #L79 - L81 were not covered by tests


@query_router.post("/v1/query/execute", summary="Query the Butler database and return full results")
def query_execute(
request: QueryExecuteRequestModel, factory: Factory = Depends(factory_dependency)
Expand Down

0 comments on commit 088d4b7

Please sign in to comment.