Compare commits
2 changed files with 7 additions and 9 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -17,9 +17,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.102"
|
||||
version = "1.0.101"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
|
||||
checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea"
|
||||
|
||||
[[package]]
|
||||
name = "async-channel"
|
||||
|
|
@ -660,9 +660,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.117"
|
||||
version = "2.0.116"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
||||
checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use isahc::{
|
|||
http::{Method, StatusCode, header},
|
||||
};
|
||||
use secrecy::SecretString;
|
||||
use tracing::{Level, debug, error, info};
|
||||
use tracing::{Level, debug, error};
|
||||
use tracing_subscriber::fmt::format::FmtSpan;
|
||||
|
||||
pub fn setup_logger(debug: bool) {
|
||||
|
|
@ -105,9 +105,8 @@ impl Client {
|
|||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(cache))]
|
||||
#[tracing::instrument(level = "info", skip(cache))]
|
||||
pub fn save_cache(&self, key: &CacheKey, cache: Vec<u8>) -> Result<()> {
|
||||
info!(?key, "save cache");
|
||||
let cache_len = cache.len();
|
||||
let cache_id = self.reserve(key, cache_len).context("reserving cache")?;
|
||||
|
||||
|
|
@ -235,9 +234,8 @@ impl Client {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug")]
|
||||
#[tracing::instrument(level = "info")]
|
||||
pub fn load_cache(&self, key: &CacheKey) -> Result<Option<Box<[u8]>>> {
|
||||
info!(?key, "load cache");
|
||||
let Some(cache_location) = self.get_cache_entry(key).context("getting cache entry")? else {
|
||||
// cache miss
|
||||
return Ok(None);
|
||||
|
|
|
|||
Loading…
Reference in a new issue