mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
build(deps): bump fred from 5.2.0 to 6.0.0 (#869)
This commit is contained in:
131
Cargo.lock
generated
131
Cargo.lock
generated
@ -19,11 +19,11 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -40,7 +40,7 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -92,7 +92,7 @@ dependencies = [
|
|||||||
"sha1",
|
"sha1",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
"zstd",
|
"zstd",
|
||||||
]
|
]
|
||||||
@ -175,7 +175,7 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio-rustls",
|
"tokio-rustls",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"webpki-roots",
|
"webpki-roots",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -916,7 +916,7 @@ dependencies = [
|
|||||||
"async-trait",
|
"async-trait",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -952,16 +952,7 @@ dependencies = [
|
|||||||
"cc",
|
"cc",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
"digest 0.10.6",
|
"digest",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "block-buffer"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1423,7 +1414,7 @@ dependencies = [
|
|||||||
"hashbrown",
|
"hashbrown",
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot_core 0.9.7",
|
"parking_lot_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1497,22 +1488,13 @@ dependencies = [
|
|||||||
"syn 1.0.109",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "digest"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.10.6"
|
version = "0.10.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer 0.10.4",
|
"block-buffer",
|
||||||
"crypto-common",
|
"crypto-common",
|
||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
@ -1692,9 +1674,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "float-cmp"
|
name = "float-cmp"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4"
|
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
@ -1731,9 +1713,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fred"
|
name = "fred"
|
||||||
version = "5.2.0"
|
version = "6.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6be0137d9045288f9c0a0659da3b74c196ad0263d2eafa0f5a73785a907bad14"
|
checksum = "c52d60e6d9b2a715da13ec520d7da6e095121e25da5027cdac56b8f96684654b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"arcstr",
|
"arcstr",
|
||||||
@ -1745,17 +1727,15 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"native-tls",
|
"parking_lot",
|
||||||
"parking_lot 0.11.2",
|
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"redis-protocol",
|
"redis-protocol",
|
||||||
"semver",
|
"semver",
|
||||||
"sha-1",
|
"sha-1",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-native-tls",
|
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util 0.6.10",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
"tracing-futures",
|
||||||
"url",
|
"url",
|
||||||
@ -2011,7 +1991,7 @@ dependencies = [
|
|||||||
"indexmap",
|
"indexmap",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2060,7 +2040,7 @@ version = "0.12.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"digest 0.10.6",
|
"digest",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2624,7 +2604,7 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"quanta",
|
"quanta",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"scheduled-thread-pool",
|
"scheduled-thread-pool",
|
||||||
@ -2730,12 +2710,6 @@ version = "1.17.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
|
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "opaque-debug"
|
|
||||||
version = "0.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl"
|
name = "openssl"
|
||||||
version = "0.10.45"
|
version = "0.10.45"
|
||||||
@ -2889,17 +2863,6 @@ version = "2.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
|
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking_lot"
|
|
||||||
version = "0.11.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
|
||||||
dependencies = [
|
|
||||||
"instant",
|
|
||||||
"lock_api",
|
|
||||||
"parking_lot_core 0.8.6",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
@ -2907,21 +2870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"parking_lot_core 0.9.7",
|
"parking_lot_core",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking_lot_core"
|
|
||||||
version = "0.8.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"instant",
|
|
||||||
"libc",
|
|
||||||
"redox_syscall",
|
|
||||||
"smallvec",
|
|
||||||
"winapi",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3225,7 +3174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93"
|
checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"scheduled-thread-pool",
|
"scheduled-thread-pool",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -3423,7 +3372,7 @@ dependencies = [
|
|||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-native-tls",
|
"tokio-native-tls",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"url",
|
"url",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@ -3731,7 +3680,7 @@ version = "0.2.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
|
checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3910,7 +3859,7 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"serial_test_derive",
|
"serial_test_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -3927,15 +3876,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha-1"
|
name = "sha-1"
|
||||||
version = "0.9.8"
|
version = "0.10.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6"
|
checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer 0.9.0",
|
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest 0.9.0",
|
"digest",
|
||||||
"opaque-debug",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3946,7 +3893,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest 0.10.6",
|
"digest",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3957,7 +3904,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest 0.10.6",
|
"digest",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4264,7 +4211,7 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
"mio",
|
"mio",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"socket2",
|
"socket2",
|
||||||
@ -4325,20 +4272,6 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tokio-util"
|
|
||||||
version = "0.6.10"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507"
|
|
||||||
dependencies = [
|
|
||||||
"bytes",
|
|
||||||
"futures-core",
|
|
||||||
"futures-sink",
|
|
||||||
"log",
|
|
||||||
"pin-project-lite",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-util"
|
name = "tokio-util"
|
||||||
version = "0.7.7"
|
version = "0.7.7"
|
||||||
@ -4420,7 +4353,7 @@ dependencies = [
|
|||||||
"prost-derive",
|
"prost-derive",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tower",
|
"tower",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
@ -4442,7 +4375,7 @@ dependencies = [
|
|||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util 0.7.7",
|
"tokio-util",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|||||||
@ -10,7 +10,7 @@ license = "Apache-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
async-trait = "0.1.66"
|
async-trait = "0.1.66"
|
||||||
error-stack = "0.3.1"
|
error-stack = "0.3.1"
|
||||||
fred = { version = "5.2.0", features = ["metrics", "partial-tracing"] }
|
fred = { version = "6.0.0", features = ["metrics", "partial-tracing"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
serde = { version = "1.0.155", features = ["derive"] }
|
serde = { version = "1.0.155", features = ["derive"] }
|
||||||
thiserror = "1.0.39"
|
thiserror = "1.0.39"
|
||||||
|
|||||||
@ -18,7 +18,7 @@ use fred::{
|
|||||||
interfaces::{HashesInterface, KeysInterface, StreamsInterface},
|
interfaces::{HashesInterface, KeysInterface, StreamsInterface},
|
||||||
types::{
|
types::{
|
||||||
Expiration, FromRedis, MultipleIDs, MultipleKeys, MultipleOrderedPairs, MultipleStrings,
|
Expiration, FromRedis, MultipleIDs, MultipleKeys, MultipleOrderedPairs, MultipleStrings,
|
||||||
RedisKey, RedisMap, RedisValue, SetOptions, XCap, XReadResponse,
|
RedisKey, RedisMap, RedisValue, Scanner, SetOptions, XCap, XReadResponse,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
@ -33,8 +33,8 @@ impl super::RedisConnectionPool {
|
|||||||
#[instrument(level = "DEBUG", skip(self))]
|
#[instrument(level = "DEBUG", skip(self))]
|
||||||
pub async fn set_key<V>(&self, key: &str, value: V) -> CustomResult<(), errors::RedisError>
|
pub async fn set_key<V>(&self, key: &str, value: V) -> CustomResult<(), errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisValue> + Debug,
|
V: TryInto<RedisValue> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.set(
|
.set(
|
||||||
@ -54,8 +54,8 @@ impl super::RedisConnectionPool {
|
|||||||
value: V,
|
value: V,
|
||||||
) -> CustomResult<MsetnxReply, errors::RedisError>
|
) -> CustomResult<MsetnxReply, errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisMap> + Debug,
|
V: TryInto<RedisMap> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.msetnx(value)
|
.msetnx(value)
|
||||||
@ -138,8 +138,8 @@ impl super::RedisConnectionPool {
|
|||||||
seconds: i64,
|
seconds: i64,
|
||||||
) -> CustomResult<(), errors::RedisError>
|
) -> CustomResult<(), errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisValue> + Debug,
|
V: TryInto<RedisValue> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.set(key, value, Some(Expiration::EX(seconds)), None, false)
|
.set(key, value, Some(Expiration::EX(seconds)), None, false)
|
||||||
@ -155,8 +155,8 @@ impl super::RedisConnectionPool {
|
|||||||
value: V,
|
value: V,
|
||||||
) -> CustomResult<SetnxReply, errors::RedisError>
|
) -> CustomResult<SetnxReply, errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisValue> + Debug,
|
V: TryInto<RedisValue> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.set(
|
.set(
|
||||||
@ -204,8 +204,8 @@ impl super::RedisConnectionPool {
|
|||||||
values: V,
|
values: V,
|
||||||
) -> CustomResult<(), errors::RedisError>
|
) -> CustomResult<(), errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisMap> + Debug,
|
V: TryInto<RedisMap> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
let output: Result<(), _> = self
|
let output: Result<(), _> = self
|
||||||
.pool
|
.pool
|
||||||
@ -228,8 +228,8 @@ impl super::RedisConnectionPool {
|
|||||||
value: V,
|
value: V,
|
||||||
) -> CustomResult<HsetnxReply, errors::RedisError>
|
) -> CustomResult<HsetnxReply, errors::RedisError>
|
||||||
where
|
where
|
||||||
V: TryInto<RedisValue> + Debug,
|
V: TryInto<RedisValue> + Debug + Send + Sync,
|
||||||
V::Error: Into<fred::error::RedisError>,
|
V::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
let output: Result<HsetnxReply, _> = self
|
let output: Result<HsetnxReply, _> = self
|
||||||
.pool
|
.pool
|
||||||
@ -378,8 +378,8 @@ impl super::RedisConnectionPool {
|
|||||||
fields: F,
|
fields: F,
|
||||||
) -> CustomResult<(), errors::RedisError>
|
) -> CustomResult<(), errors::RedisError>
|
||||||
where
|
where
|
||||||
F: TryInto<MultipleOrderedPairs> + Debug,
|
F: TryInto<MultipleOrderedPairs> + Debug + Send + Sync,
|
||||||
F::Error: Into<fred::error::RedisError>,
|
F::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xadd(stream, false, None, entry_id, fields)
|
.xadd(stream, false, None, entry_id, fields)
|
||||||
@ -395,7 +395,7 @@ impl super::RedisConnectionPool {
|
|||||||
ids: Ids,
|
ids: Ids,
|
||||||
) -> CustomResult<usize, errors::RedisError>
|
) -> CustomResult<usize, errors::RedisError>
|
||||||
where
|
where
|
||||||
Ids: Into<MultipleStrings> + Debug,
|
Ids: Into<MultipleStrings> + Debug + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xdel(stream, ids)
|
.xdel(stream, ids)
|
||||||
@ -411,8 +411,8 @@ impl super::RedisConnectionPool {
|
|||||||
xcap: C,
|
xcap: C,
|
||||||
) -> CustomResult<usize, errors::RedisError>
|
) -> CustomResult<usize, errors::RedisError>
|
||||||
where
|
where
|
||||||
C: TryInto<XCap> + Debug,
|
C: TryInto<XCap> + Debug + Send + Sync,
|
||||||
C::Error: Into<fred::error::RedisError>,
|
C::Error: Into<fred::error::RedisError> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xtrim(stream, xcap)
|
.xtrim(stream, xcap)
|
||||||
@ -429,7 +429,7 @@ impl super::RedisConnectionPool {
|
|||||||
ids: Ids,
|
ids: Ids,
|
||||||
) -> CustomResult<usize, errors::RedisError>
|
) -> CustomResult<usize, errors::RedisError>
|
||||||
where
|
where
|
||||||
Ids: Into<MultipleIDs> + Debug,
|
Ids: Into<MultipleIDs> + Debug + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xack(stream, group, ids)
|
.xack(stream, group, ids)
|
||||||
@ -441,7 +441,7 @@ impl super::RedisConnectionPool {
|
|||||||
#[instrument(level = "DEBUG", skip(self))]
|
#[instrument(level = "DEBUG", skip(self))]
|
||||||
pub async fn stream_get_length<K>(&self, stream: K) -> CustomResult<usize, errors::RedisError>
|
pub async fn stream_get_length<K>(&self, stream: K) -> CustomResult<usize, errors::RedisError>
|
||||||
where
|
where
|
||||||
K: Into<RedisKey> + Debug,
|
K: Into<RedisKey> + Debug + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xlen(stream)
|
.xlen(stream)
|
||||||
@ -458,8 +458,8 @@ impl super::RedisConnectionPool {
|
|||||||
read_count: Option<u64>,
|
read_count: Option<u64>,
|
||||||
) -> CustomResult<XReadResponse<String, String, String, String>, errors::RedisError>
|
) -> CustomResult<XReadResponse<String, String, String, String>, errors::RedisError>
|
||||||
where
|
where
|
||||||
K: Into<MultipleKeys> + Debug,
|
K: Into<MultipleKeys> + Debug + Send + Sync,
|
||||||
Ids: Into<MultipleIDs> + Debug,
|
Ids: Into<MultipleIDs> + Debug + Send + Sync,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
.xread_map(
|
.xread_map(
|
||||||
@ -483,8 +483,8 @@ impl super::RedisConnectionPool {
|
|||||||
group: Option<(&str, &str)>, // (group_name, consumer_name)
|
group: Option<(&str, &str)>, // (group_name, consumer_name)
|
||||||
) -> CustomResult<XReadResponse<String, String, String, Option<String>>, errors::RedisError>
|
) -> CustomResult<XReadResponse<String, String, String, Option<String>>, errors::RedisError>
|
||||||
where
|
where
|
||||||
K: Into<MultipleKeys> + Debug,
|
K: Into<MultipleKeys> + Debug + Send + Sync,
|
||||||
Ids: Into<MultipleIDs> + Debug,
|
Ids: Into<MultipleIDs> + Debug + Send + Sync,
|
||||||
{
|
{
|
||||||
match group {
|
match group {
|
||||||
Some((group_name, consumer_name)) => {
|
Some((group_name, consumer_name)) => {
|
||||||
@ -574,7 +574,7 @@ impl super::RedisConnectionPool {
|
|||||||
ids: Ids,
|
ids: Ids,
|
||||||
) -> CustomResult<R, errors::RedisError>
|
) -> CustomResult<R, errors::RedisError>
|
||||||
where
|
where
|
||||||
Ids: Into<MultipleIDs> + Debug,
|
Ids: Into<MultipleIDs> + Debug + Send + Sync,
|
||||||
R: FromRedis + Unpin + Send + 'static,
|
R: FromRedis + Unpin + Send + 'static,
|
||||||
{
|
{
|
||||||
self.pool
|
self.pool
|
||||||
|
|||||||
@ -27,7 +27,6 @@ use common_utils::errors::CustomResult;
|
|||||||
use error_stack::{IntoReport, ResultExt};
|
use error_stack::{IntoReport, ResultExt};
|
||||||
use fred::interfaces::ClientLike;
|
use fred::interfaces::ClientLike;
|
||||||
pub use fred::interfaces::PubsubInterface;
|
pub use fred::interfaces::PubsubInterface;
|
||||||
use futures::StreamExt;
|
|
||||||
use router_env::logger;
|
use router_env::logger;
|
||||||
|
|
||||||
pub use self::{commands::*, types::*};
|
pub use self::{commands::*, types::*};
|
||||||
@ -55,10 +54,10 @@ impl std::ops::Deref for RedisClient {
|
|||||||
impl RedisClient {
|
impl RedisClient {
|
||||||
pub async fn new(
|
pub async fn new(
|
||||||
config: fred::types::RedisConfig,
|
config: fred::types::RedisConfig,
|
||||||
policy: fred::types::ReconnectPolicy,
|
reconnect_policy: fred::types::ReconnectPolicy,
|
||||||
) -> CustomResult<Self, errors::RedisError> {
|
) -> CustomResult<Self, errors::RedisError> {
|
||||||
let client = fred::prelude::RedisClient::new(config);
|
let client = fred::prelude::RedisClient::new(config, None, Some(reconnect_policy));
|
||||||
client.connect(Some(policy));
|
client.connect();
|
||||||
client
|
client
|
||||||
.wait_for_connect()
|
.wait_for_connect()
|
||||||
.await
|
.await
|
||||||
@ -96,22 +95,22 @@ impl RedisConnectionPool {
|
|||||||
if !conf.use_legacy_version {
|
if !conf.use_legacy_version {
|
||||||
config.version = fred::types::RespVersion::RESP3;
|
config.version = fred::types::RespVersion::RESP3;
|
||||||
}
|
}
|
||||||
config.tracing = true;
|
config.tracing = fred::types::TracingConfig::new(true);
|
||||||
config.blocking = fred::types::Blocking::Error;
|
config.blocking = fred::types::Blocking::Error;
|
||||||
let policy = fred::types::ReconnectPolicy::new_constant(
|
let reconnect_policy = fred::types::ReconnectPolicy::new_constant(
|
||||||
conf.reconnect_max_attempts,
|
conf.reconnect_max_attempts,
|
||||||
conf.reconnect_delay,
|
conf.reconnect_delay,
|
||||||
);
|
);
|
||||||
|
|
||||||
let subscriber = RedisClient::new(config.clone(), policy.clone()).await?;
|
let subscriber = RedisClient::new(config.clone(), reconnect_policy.clone()).await?;
|
||||||
|
|
||||||
let publisher = RedisClient::new(config.clone(), policy.clone()).await?;
|
let publisher = RedisClient::new(config.clone(), reconnect_policy.clone()).await?;
|
||||||
|
|
||||||
let pool = fred::pool::RedisPool::new(config, conf.pool_size)
|
let pool = fred::pool::RedisPool::new(config, None, Some(reconnect_policy), conf.pool_size)
|
||||||
.into_report()
|
.into_report()
|
||||||
.change_context(errors::RedisError::RedisConnectionError)?;
|
.change_context(errors::RedisError::RedisConnectionError)?;
|
||||||
|
|
||||||
let join_handles = pool.connect(Some(policy));
|
let join_handles = pool.connect();
|
||||||
pool.wait_for_connect()
|
pool.wait_for_connect()
|
||||||
.await
|
.await
|
||||||
.into_report()
|
.into_report()
|
||||||
@ -140,17 +139,13 @@ impl RedisConnectionPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub async fn on_error(&self) {
|
pub async fn on_error(&self) {
|
||||||
self.pool
|
while let Ok(redis_error) = self.pool.on_error().recv().await {
|
||||||
.on_error()
|
logger::error!(?redis_error, "Redis protocol or connection error");
|
||||||
.for_each(|err| {
|
if self.pool.state() == fred::types::ClientState::Disconnected {
|
||||||
logger::error!("{err:?}");
|
self.is_redis_available
|
||||||
if self.pool.state() == fred::types::ClientState::Disconnected {
|
.store(false, atomic::Ordering::SeqCst);
|
||||||
self.is_redis_available
|
}
|
||||||
.store(false, atomic::Ordering::SeqCst);
|
}
|
||||||
}
|
|
||||||
futures::future::ready(())
|
|
||||||
})
|
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ pub mod logger;
|
|||||||
use std::sync::{atomic, Arc};
|
use std::sync::{atomic, Arc};
|
||||||
|
|
||||||
use error_stack::{IntoReport, ResultExt};
|
use error_stack::{IntoReport, ResultExt};
|
||||||
use futures::StreamExt;
|
|
||||||
use redis_interface::{errors as redis_errors, PubsubInterface};
|
use redis_interface::{errors as redis_errors, PubsubInterface};
|
||||||
|
|
||||||
pub use self::{api::*, encryption::*};
|
pub use self::{api::*, encryption::*};
|
||||||
@ -24,11 +23,13 @@ pub trait PubSubInterface {
|
|||||||
&self,
|
&self,
|
||||||
channel: &str,
|
channel: &str,
|
||||||
) -> errors::CustomResult<usize, redis_errors::RedisError>;
|
) -> errors::CustomResult<usize, redis_errors::RedisError>;
|
||||||
|
|
||||||
async fn publish(
|
async fn publish(
|
||||||
&self,
|
&self,
|
||||||
channel: &str,
|
channel: &str,
|
||||||
key: &str,
|
key: &str,
|
||||||
) -> errors::CustomResult<usize, redis_errors::RedisError>;
|
) -> errors::CustomResult<usize, redis_errors::RedisError>;
|
||||||
|
|
||||||
async fn on_message(&self) -> errors::CustomResult<(), redis_errors::RedisError>;
|
async fn on_message(&self) -> errors::CustomResult<(), redis_errors::RedisError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ impl PubSubInterface for redis_interface::RedisConnectionPool {
|
|||||||
.into_report()
|
.into_report()
|
||||||
.change_context(redis_errors::RedisError::SubscribeError)
|
.change_context(redis_errors::RedisError::SubscribeError)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
async fn publish(
|
async fn publish(
|
||||||
&self,
|
&self,
|
||||||
@ -57,11 +59,13 @@ impl PubSubInterface for redis_interface::RedisConnectionPool {
|
|||||||
.into_report()
|
.into_report()
|
||||||
.change_context(redis_errors::RedisError::SubscribeError)
|
.change_context(redis_errors::RedisError::SubscribeError)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
async fn on_message(&self) -> errors::CustomResult<(), redis_errors::RedisError> {
|
async fn on_message(&self) -> errors::CustomResult<(), redis_errors::RedisError> {
|
||||||
let mut message = self.subscriber.on_message();
|
let mut rx = self.subscriber.on_message();
|
||||||
while let Some((_, key)) = message.next().await {
|
while let Ok(message) = rx.recv().await {
|
||||||
let key = key
|
let key = message
|
||||||
|
.value
|
||||||
.as_string()
|
.as_string()
|
||||||
.ok_or::<redis_errors::RedisError>(redis_errors::RedisError::DeleteFailed)?;
|
.ok_or::<redis_errors::RedisError>(redis_errors::RedisError::DeleteFailed)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user