diff --git a/Cargo.lock b/Cargo.lock index 3099dff..5d89b83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -439,7 +439,7 @@ dependencies = [ "blue-build-template", "blue-build-utils", "bon", - "cached", + "cached 0.55.1", "clap", "clap-verbosity-flag", "clap_complete", @@ -482,7 +482,7 @@ dependencies = [ "anyhow", "blue-build-utils", "bon", - "cached", + "cached 0.55.1", "chrono", "clap", "colored", @@ -552,7 +552,7 @@ dependencies = [ "base64 0.22.1", "blake2", "bon", - "cached", + "cached 0.55.1", "chrono", "clap", "comlexr", @@ -647,7 +647,7 @@ checksum = "9718806c4a2fe9e8a56fd736f97b340dd10ed1be8ed733ed50449f351dc33cae" dependencies = [ "ahash 0.8.11", "async-trait", - "cached_proc_macro", + "cached_proc_macro 0.23.0", "cached_proc_macro_types", "futures", "hashbrown 0.14.5", @@ -657,6 +657,24 @@ dependencies = [ "web-time", ] +[[package]] +name = "cached" +version = "0.55.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0839c297f8783316fcca9d90344424e968395413f0662a5481f79c6648bbc14" +dependencies = [ + "ahash 0.8.11", + "async-trait", + "cached_proc_macro 0.24.0", + "cached_proc_macro_types", + "futures", + "hashbrown 0.14.5", + "once_cell", + "thiserror 2.0.12", + "tokio", + "web-time", +] + [[package]] name = "cached_proc_macro" version = "0.23.0" @@ -669,6 +687,18 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "cached_proc_macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673992d934f0711b68ebb3e1b79cdc4be31634b37c98f26867ced0438ca5c603" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "cached_proc_macro_types" version = "0.1.1" @@ -4431,7 +4461,7 @@ checksum = "9958ac57dea620d4059784dc0df9f997a873a168828d1028c5c7b9d7a089f5f2" dependencies = [ "async-trait", "base64 0.22.1", - "cached", + "cached 0.54.0", "cfg-if", "chrono", "const-oid", diff --git a/Cargo.toml b/Cargo.toml index c3ac3d1..32a27ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ version = "0.9.10" [workspace.dependencies] bon = "3" -cached = "0.54" +cached = "0.55" chrono = "0.4" clap = "4" colored = "2" diff --git a/process/drivers.rs b/process/drivers.rs index baed928..6777fca 100644 --- a/process/drivers.rs +++ b/process/drivers.rs @@ -254,7 +254,7 @@ impl Driver { result = true, key = "String", convert = r#"{ oci_ref.to_string() }"#, - sync_writes = true + sync_writes = "by_key" )] fn get_version_run_image(oci_ref: &Reference) -> Result { warn!(concat!( diff --git a/process/drivers/docker_driver.rs b/process/drivers/docker_driver.rs index 6aa11f3..c1f4233 100644 --- a/process/drivers/docker_driver.rs +++ b/process/drivers/docker_driver.rs @@ -432,7 +432,7 @@ impl InspectDriver for DockerDriver { result = true, key = "String", convert = r#"{ format!("{}-{}", opts.image, opts.platform)}"#, - sync_writes = true + sync_writes = "by_key" )] fn get_metadata_cache(opts: &GetMetadataOpts) -> Result { trace!("DockerDriver::get_metadata({opts:#?})"); diff --git a/process/drivers/podman_driver.rs b/process/drivers/podman_driver.rs index 0bfa91f..3016306 100644 --- a/process/drivers/podman_driver.rs +++ b/process/drivers/podman_driver.rs @@ -326,7 +326,7 @@ impl InspectDriver for PodmanDriver { result = true, key = "String", convert = r#"{ format!("{}-{}", opts.image, opts.platform)}"#, - sync_writes = true + sync_writes = "by_key" )] fn get_metadata_cache(opts: &GetMetadataOpts) -> Result { trace!("PodmanDriver::get_metadata({opts:#?})"); diff --git a/process/drivers/skopeo_driver.rs b/process/drivers/skopeo_driver.rs index acdfa5d..1616d5b 100644 --- a/process/drivers/skopeo_driver.rs +++ b/process/drivers/skopeo_driver.rs @@ -24,7 +24,7 @@ impl InspectDriver for SkopeoDriver { result = true, key = "String", convert = r#"{ format!("{}-{}", opts.image, opts.platform)}"#, - sync_writes = true + sync_writes = "by_key" )] fn get_metadata_cache(opts: &GetMetadataOpts) -> Result { trace!("SkopeoDriver::get_metadata({opts:#?})"); diff --git a/src/commands/generate.rs b/src/commands/generate.rs index 3f0fcb9..ffd886b 100644 --- a/src/commands/generate.rs +++ b/src/commands/generate.rs @@ -181,7 +181,7 @@ impl GenerateCommand { result = true, key = "Platform", convert = r#"{ platform }"#, - sync_writes = true + sync_writes = "by_key" )] fn determine_scripts_tag(platform: Platform) -> Result { trace!("determine_scripts_tag({platform:?})"); diff --git a/src/commands/validate/schema_validator.rs b/src/commands/validate/schema_validator.rs index 18ddcba..fb2dd67 100644 --- a/src/commands/validate/schema_validator.rs +++ b/src/commands/validate/schema_validator.rs @@ -313,7 +313,12 @@ impl Retrieve for ModuleSchemaRetriever { } } -#[cached(result = true, key = "String", convert = r#"{ format!("{uri}") }"#)] +#[cached( + result = true, + key = "String", + convert = r#"{ format!("{uri}") }"#, + sync_writes = "by_key" +)] async fn cache_retrieve(uri: &Uri) -> miette::Result { let scheme = uri.scheme(); let path = uri.path();