From 1d1be6aeafe8862a9a0af78be21d41ed5aecaaee Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Thu, 28 Dec 2023 09:24:40 -0500 Subject: [PATCH 1/2] bump redis to 0.24. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ce836be..e943894 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ version = "0.1" optional = true [dependencies.redis] -version = "0.23" +version = "0.24" features = ["r2d2"] optional = true From 6826bf0c94d538469c920e95affc23cbc1755a20 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 31 Dec 2023 08:51:12 -0500 Subject: [PATCH 2/2] cast second to required type due to redis 0.24 changes --- src/stores/redis.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stores/redis.rs b/src/stores/redis.rs index 5878b7d..fe15229 100644 --- a/src/stores/redis.rs +++ b/src/stores/redis.rs @@ -271,7 +271,7 @@ where pipe.get(key.clone()); if self.refresh { - pipe.expire(key, self.seconds as usize).ignore(); + pipe.expire(key, self.seconds as i64).ignore(); } // ugh: https://github.com/mitsuhiko/redis-rs/pull/388#issuecomment-910919137 let res: (Option,) = pipe.query(&mut *conn)?; @@ -300,7 +300,7 @@ where key, serde_json::to_string(&val) .map_err(|e| RedisCacheError::CacheSerializationError { error: e })?, - self.seconds as usize, + self.seconds, ) .ignore(); @@ -555,7 +555,7 @@ mod async_redis { pipe.get(key.clone()); if self.refresh { - pipe.expire(key, self.seconds as usize).ignore(); + pipe.expire(key, self.seconds as i64).ignore(); } let res: (Option,) = pipe.query_async(&mut conn).await?; match res.0 { @@ -584,7 +584,7 @@ mod async_redis { key, serde_json::to_string(&val) .map_err(|e| RedisCacheError::CacheSerializationError { error: e })?, - self.seconds as usize, + self.seconds as u64, ) .ignore();