mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-28 11:18:17 -07:00
general: update
This commit is contained in:
@@ -49,10 +49,6 @@ fn _dataset_handler(
|
||||
query: Query<Params>,
|
||||
AppState { routes }: AppState,
|
||||
) -> color_eyre::Result<Response> {
|
||||
if path.contains("favicon") {
|
||||
return Err(eyre!("Don't support favicon"));
|
||||
}
|
||||
|
||||
log(&format!(
|
||||
"{}{}",
|
||||
path,
|
||||
@@ -98,11 +94,13 @@ fn _dataset_handler(
|
||||
match kind {
|
||||
Kind::Date => {
|
||||
let datasets = DateMap::<usize>::_read_dir(&route.file_path, &route.serialization);
|
||||
|
||||
process_datasets(headers, kind, &mut chunk, &mut route, query, datasets)?;
|
||||
}
|
||||
Kind::Height => {
|
||||
let datasets =
|
||||
HeightMap::<usize>::_read_dir(&route.file_path, &route.serialization);
|
||||
|
||||
process_datasets(headers, kind, &mut chunk, &mut route, query, datasets)?;
|
||||
}
|
||||
_ => panic!(),
|
||||
@@ -159,7 +157,9 @@ where
|
||||
return Err(eyre!("Couldn't find chunk"));
|
||||
}
|
||||
|
||||
route.file_path = path.unwrap().to_str().unwrap().to_string();
|
||||
let path = path.unwrap();
|
||||
|
||||
route.file_path = path.to_str().unwrap().to_string();
|
||||
|
||||
let offset = match kind {
|
||||
Kind::Date => 1,
|
||||
|
||||
@@ -54,14 +54,14 @@ fn value_to_response<T>(value: T) -> Response
|
||||
where
|
||||
T: Serialize,
|
||||
{
|
||||
generic_to_reponse(value, None, 5)
|
||||
generic_to_reponse(value, None, 1)
|
||||
}
|
||||
|
||||
fn dataset_to_response<T>(dataset: T, chunk: Chunk) -> Response
|
||||
where
|
||||
T: Serialize,
|
||||
{
|
||||
generic_to_reponse(dataset, Some(chunk), 60)
|
||||
generic_to_reponse(dataset, Some(chunk), 5)
|
||||
}
|
||||
|
||||
pub fn generic_to_reponse<T>(generic: T, chunk: Option<Chunk>, cache_time: u64) -> Response
|
||||
@@ -71,7 +71,7 @@ where
|
||||
let mut response = {
|
||||
if let Some(chunk) = chunk {
|
||||
Json(WrappedDataset {
|
||||
source: "https://satonomics.xyz",
|
||||
source: "https://kibo.money",
|
||||
chunk,
|
||||
dataset: generic,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user