This commit is contained in:
Eelco Dolstra 2024-02-29 22:48:51 +01:00
parent e99ef6ba61
commit b53876db25
2 changed files with 5 additions and 5 deletions

View file

@ -51,7 +51,7 @@ async fn get_narinfo(
let key = format!("{}.narinfo", store_path_hash);
if state
.narinfo_nagative_cache
.narinfo_negative_cache
.read()
.await
.contains(&store_path_hash)
@ -68,7 +68,7 @@ async fn get_narinfo(
}
}
let mut negative_cache = state.narinfo_nagative_cache.write().await;
let mut negative_cache = state.narinfo_negative_cache.write().await;
negative_cache.insert(store_path_hash);
state.metrics.narinfos_sent_upstream.incr();
@ -103,7 +103,7 @@ async fn put_narinfo(
state.metrics.narinfos_uploaded.incr();
state
.narinfo_nagative_cache
.narinfo_negative_cache
.write()
.await
.remove(&store_path_hash);

View file

@ -123,7 +123,7 @@ struct StateInner {
shutdown_sender: Mutex<Option<oneshot::Sender<()>>>,
/// Set of store path hashes that are not present in GHAC.
narinfo_nagative_cache: RwLock<HashSet<String>>,
narinfo_negative_cache: RwLock<HashSet<String>>,
/// Metrics for sending to perf at shutdown
metrics: Arc<telemetry::TelemetryReport>,
@ -301,7 +301,7 @@ async fn main_cli() -> Result<()> {
gha_cache,
upstream: args.upstream.clone(),
shutdown_sender: Mutex::new(Some(shutdown_sender)),
narinfo_nagative_cache: RwLock::new(HashSet::new()),
narinfo_negative_cache: RwLock::new(HashSet::new()),
metrics,
store,
flakehub_state: RwLock::new(flakehub_state),