chore: add expire duration
This commit is contained in:
parent
10fc8dd2fe
commit
8e9031c669
|
|
@ -29,7 +29,7 @@ impl SnapshotCache {
|
||||||
pub async fn insert(&self, key: &str, value: Vec<u8>) -> Result<(), AppError> {
|
pub async fn insert(&self, key: &str, value: Vec<u8>) -> Result<(), AppError> {
|
||||||
let mut redis = self.redis_client.lock().await;
|
let mut redis = self.redis_client.lock().await;
|
||||||
redis
|
redis
|
||||||
.set(key, value)
|
.set_ex(key, value, 60 * 60 * 24)
|
||||||
.await
|
.await
|
||||||
.map_err(|err| AppError::Internal(err.into()))?;
|
.map_err(|err| AppError::Internal(err.into()))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue