From 8e9031c6692a73b4ceb2c94ae887af5fa3d42afe Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 24 Feb 2024 15:47:28 +0800 Subject: [PATCH] chore: add expire duration --- src/biz/snapshot/cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biz/snapshot/cache.rs b/src/biz/snapshot/cache.rs index 34f45c72..47048ed3 100644 --- a/src/biz/snapshot/cache.rs +++ b/src/biz/snapshot/cache.rs @@ -29,7 +29,7 @@ impl SnapshotCache { pub async fn insert(&self, key: &str, value: Vec) -> Result<(), AppError> { let mut redis = self.redis_client.lock().await; redis - .set(key, value) + .set_ex(key, value, 60 * 60 * 24) .await .map_err(|err| AppError::Internal(err.into()))?; Ok(())