WIP on json endpoint
This commit is contained in:
@@ -208,7 +208,7 @@ async fn binned(req: Request<Body>, node_config: &NodeConfigCached) -> Result<Re
|
||||
|
||||
async fn binned_binary(query: BinnedQuery, node_config: &NodeConfigCached) -> Result<Response<Body>, Error> {
|
||||
info!("binned_binary");
|
||||
let ret = match disk::cache::binned_bytes_for_http(node_config, &query).await {
|
||||
let ret = match disk::binned::binned_bytes_for_http(node_config, &query).await {
|
||||
Ok(s) => response(StatusCode::OK).body(BodyStream::wrapped(s, format!("desc-BINNED")))?,
|
||||
Err(e) => {
|
||||
error!("fn binned: {:?}", e);
|
||||
@@ -220,8 +220,11 @@ async fn binned_binary(query: BinnedQuery, node_config: &NodeConfigCached) -> Re
|
||||
|
||||
async fn binned_json(query: BinnedQuery, node_config: &NodeConfigCached) -> Result<Response<Body>, Error> {
|
||||
info!("binned_json");
|
||||
let ret = match disk::cache::binned_bytes_for_http(node_config, &query).await {
|
||||
Ok(s) => response(StatusCode::OK).body(BodyStream::wrapped(s, format!("desc-BINNED")))?,
|
||||
let ret = match disk::binned::binned_json(node_config, &query).await {
|
||||
Ok(val) => {
|
||||
let body = serde_json::to_string(&val)?;
|
||||
response(StatusCode::OK).body(Body::from(body))
|
||||
}?,
|
||||
Err(e) => {
|
||||
error!("fn binned: {:?}", e);
|
||||
response(StatusCode::INTERNAL_SERVER_ERROR).body(Body::empty())?
|
||||
|
||||
Reference in New Issue
Block a user