0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-12-22 20:38:22 -05:00

Update redis_cacher.rs

This commit is contained in:
alamin655 2023-11-20 21:09:27 +05:30 committed by GitHub
parent a2360d1f65
commit fc830c4683
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
use error_stack::Report;
use futures::future::try_join_all;
use sha256::digest;
use blake3::hash;
use redis::{aio::ConnectionManager, AsyncCommands, Client, RedisError};
use super::error::CacheError;
@ -59,7 +59,7 @@ impl RedisCache {
///
/// * `url` - It takes an url as string.
fn hash_url(&self, url: &str) -> String {
digest(url)
format!("{:?}", blake3::hash(url.as_bytes()))
}
/// A function which fetches the cached json results as json string from the redis server.