Refresh Rust dependencies and replace abandoned crates
This commit is contained in:
parent
722c673d1e
commit
e5c24f7c71
2 changed files with 602 additions and 711 deletions
|
|
@ -7,7 +7,7 @@ rust-version.workspace = true
|
|||
version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
redis = { version = "0.32.7", default-features = false, features = [
|
||||
redis = { version = "1.6.0", default-features = false, features = [
|
||||
"aio",
|
||||
"connection-manager",
|
||||
"script",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use redis::aio::{ConnectionManager, ConnectionManagerConfig};
|
||||
use redis::{AsyncCommands, Client, FromRedisValue, RedisResult, Value};
|
||||
use redis::{AsyncCommands, Client, FromRedisValue, Value};
|
||||
|
||||
use crate::error::CoordinationError;
|
||||
use crate::keys::KeySpace;
|
||||
|
|
@ -52,9 +52,9 @@ impl CoordinationStore {
|
|||
CoordinationError::config(format!("invalid coordination URL: {error}"))
|
||||
})?;
|
||||
let connection_config = ConnectionManagerConfig::new()
|
||||
.set_connection_timeout(Duration::from_secs(3))
|
||||
.set_response_timeout(Duration::from_secs(5))
|
||||
.set_max_delay(1_000);
|
||||
.set_connection_timeout(Some(Duration::from_secs(3)))
|
||||
.set_response_timeout(Some(Duration::from_secs(5)))
|
||||
.set_max_delay(Duration::from_millis(1_000));
|
||||
let conn = ConnectionManager::new_with_config(client, connection_config).await?;
|
||||
Ok(Self {
|
||||
conn,
|
||||
|
|
@ -497,8 +497,7 @@ fn value_to_strings(value: &Value) -> Result<Vec<String>, CoordinationError> {
|
|||
Value::Int(n) => out.push(n.to_string()),
|
||||
other => {
|
||||
// Fall back to Redis display for unexpected tags.
|
||||
let as_string: RedisResult<String> =
|
||||
FromRedisValue::from_redis_value(other);
|
||||
let as_string = String::from_redis_value_ref(other);
|
||||
out.push(as_string.unwrap_or_else(|_| format!("{other:?}")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue