Skip to content

Commit

Permalink
fix(deps): update rust crate redis to 0.28.0 (#37)
Browse files Browse the repository at this point in the history
* fix(deps): update rust crate redis to 0.28.0
* deps: updated redis to 0.28.1 & redis-test to 0.8.0
* fix: new version of redis requires Send trait

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: AH-dark <[email protected]>
  • Loading branch information
renovate[bot] and AH-dark authored Jan 12, 2025
1 parent a791254 commit ac8e19f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync"
uuid = { version = "1", features = ["v4"] }

etcd-client = { version = "0.14", optional = true }
redis = { version = "0.27.6", optional = true, features = ["tokio-comp"] }
redis = { version = "0.28.1", optional = true, features = ["tokio-comp"] }

[dev-dependencies]
pretty_env_logger = "0.5"
redis-test = { version = "0.6.0", features = ["aio"] }
redis-test = { version = "0.8.0", features = ["aio"] }
6 changes: 3 additions & 3 deletions src/driver/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ where
/// * `node_id` - The id of the node
/// * `timeout` - The timeout of the node
/// * `con` - The redis connection
async fn register_node<C: ConnectionLike + Send>(
async fn register_node<C: ConnectionLike + Send + Sync>(
node_id: &str,
timeout: u64,
con: &mut C,
) -> Result<(), Box<dyn std::error::Error>> {
) -> Result<(), redis::RedisError> {
con.set_ex(node_id, node_id, timeout).await?;
Ok(())
}
Expand All @@ -161,7 +161,7 @@ async fn register_node<C: ConnectionLike + Send>(
/// # Returns
///
/// * `Result<(), Box<dyn std::error::Error>` - The result of the function
async fn heartbeat<C: ConnectionLike + Send>(
async fn heartbeat<C: ConnectionLike + Send + Sync>(
node_id: &str,
timeout: u64,
con: C,
Expand Down
4 changes: 2 additions & 2 deletions src/driver/redis_zset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ where
/// * `node_id` - The id of the node
/// * `con` - The redis connection
/// * `time` - The time to register the node
async fn register_node<C: ConnectionLike + Send>(
async fn register_node<C: ConnectionLike + Send + Sync>(
service_name: &str,
node_id: &str,
con: &mut C,
time: i64,
) -> Result<(), Box<dyn std::error::Error>> {
) -> Result<(), redis::RedisError> {
con.zadd(utils::get_zset_key(service_name), node_id, time).await?;

Ok(())
Expand Down

0 comments on commit ac8e19f

Please sign in to comment.