Generate and read channel config for test case

This commit is contained in:
Dominik Werder
2021-04-19 18:59:07 +02:00
parent 8c328cf6cf
commit d8ab42ccb9
8 changed files with 152 additions and 72 deletions

View File

@@ -216,16 +216,8 @@ where
async fn binned(req: Request<Body>, node_config: Arc<NodeConfig>) -> Result<Response<Body>, Error> {
info!("-------------------------------------------------------- BINNED");
let (head, _body) = req.into_parts();
//let params = netpod::query_params(head.uri.query());
// TODO
// Channel, time range, bin size.
// Try to locate that file in cache, otherwise create it on the fly:
// Look up and parse channel config.
// Extract the relevant channel config entry.
let query = disk::cache::Query::from_request(&head)?;
let ret = match disk::cache::binned_bytes_for_http(node_config, &query) {
let ret = match disk::cache::binned_bytes_for_http(node_config, &query).await {
Ok(s) => response(StatusCode::OK).body(BodyStream::wrapped(s))?,
Err(e) => {
error!("{:?}", e);