Skip to content

Commit 468e58f

Browse files
committed
Use Unified cache_key
1. Fix saucenao cache_key contains / 2. let ex and eh cache_key the same
1 parent 251fe56 commit 468e58f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

eh2telegraph/src/sync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ where
9292
<C::ImageStream as AsyncStream>::Future: Send + 'static,
9393
{
9494
// check cache
95-
let cache_key = format!("{}|{}", C::name(), path);
95+
let path = path.trim_end_matches('/').to_string();
96+
let original_cache_key = format!("{}|{}", C::name(), path);
97+
let cache_key = original_cache_key.replace("exhentai", "e-hentai");
9698
if let Ok(Some(v)) = self.cache.get(&cache_key).await {
9799
tracing::info!("[cache] hit key {cache_key}");
98100
return Ok(v);

0 commit comments

Comments
 (0)