general: update

This commit is contained in:
k
2024-09-18 00:14:53 +02:00
parent da7c114d41
commit 52a65fcad1
51 changed files with 753 additions and 657 deletions
+5 -5
View File
@@ -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,
+3 -3
View File
@@ -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,
})