From baffb873ae72af25ff898a687ee164ab58021de3 Mon Sep 17 00:00:00 2001 From: Robert Kwolek Date: Fri, 20 Dec 2024 15:00:28 +0100 Subject: [PATCH] fix: semver check added for redis version --- Cargo.lock | 13 +++++++------ Cargo.toml | 3 ++- affinidi-messaging-mediator/Cargo.toml | 1 + .../src/database/handlers.rs | 15 +++++++++------ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d683cb5..c40f330 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,7 +103,7 @@ dependencies = [ [[package]] name = "affinidi-messaging-didcomm" -version = "0.8.3" +version = "0.8.4" dependencies = [ "affinidi-did-resolver-cache-sdk", "anyhow", @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "affinidi-messaging-helpers" -version = "0.8.3" +version = "0.8.4" dependencies = [ "affinidi-did-resolver-cache-sdk", "affinidi-messaging-didcomm", @@ -160,7 +160,7 @@ dependencies = [ [[package]] name = "affinidi-messaging-mediator" -version = "0.8.3" +version = "0.8.4" dependencies = [ "affinidi-did-resolver-cache-sdk", "affinidi-messaging-didcomm", @@ -192,6 +192,7 @@ dependencies = [ "reqwest 0.12.9", "ring", "rustls 0.23.20", + "semver", "serde", "serde_json", "sha256", @@ -208,14 +209,14 @@ dependencies = [ [[package]] name = "affinidi-messaging-processor" -version = "0.8.3" +version = "0.8.4" dependencies = [ "tokio", ] [[package]] name = "affinidi-messaging-sdk" -version = "0.8.3" +version = "0.8.4" dependencies = [ "affinidi-did-resolver-cache-sdk", "affinidi-messaging-didcomm", @@ -253,7 +254,7 @@ dependencies = [ [[package]] name = "affinidi-messaging-text-client" -version = "0.8.3" +version = "0.8.4" dependencies = [ "affinidi-did-resolver-cache-sdk", "affinidi-messaging-didcomm", diff --git a/Cargo.toml b/Cargo.toml index fb97199..0e74c8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ resolver = "2" [workspace.package] -version = '0.8.3' +version = '0.8.4' edition = "2021" authors = ["Glenn Gore "] description = "Affinidi Messaging" @@ -105,3 +105,4 @@ tui-logger = { version = "0.14", features = ["tracing-support"] } url = "2.5" uuid = { version = "1.11", features = ["v4", "fast-rng"] } varint = "0.9" +semver = "1.0.24" \ No newline at end of file diff --git a/affinidi-messaging-mediator/Cargo.toml b/affinidi-messaging-mediator/Cargo.toml index a3fc537..34be8ce 100644 --- a/affinidi-messaging-mediator/Cargo.toml +++ b/affinidi-messaging-mediator/Cargo.toml @@ -49,6 +49,7 @@ tower-http.workspace = true tracing.workspace = true tracing-subscriber.workspace = true uuid.workspace = true +semver.workspace = true [dev-dependencies] console.workspace = true diff --git a/affinidi-messaging-mediator/src/database/handlers.rs b/affinidi-messaging-mediator/src/database/handlers.rs index 1238fab..584f0ec 100644 --- a/affinidi-messaging-mediator/src/database/handlers.rs +++ b/affinidi-messaging-mediator/src/database/handlers.rs @@ -2,10 +2,11 @@ use super::DatabaseHandler; use crate::common::{config::Config, errors::MediatorError}; use deadpool_redis::Connection; use redis::aio::PubSub; +use semver::{Version, VersionReq}; use std::{fs::read_to_string, thread::sleep, time::Duration}; use tracing::{error, event, info, Level}; -const REDIS_VERSION: &str = "7.2"; // required Redis version +const REDIS_VERSION_REQ: &str = ">=7.2, <8.0"; impl DatabaseHandler { pub async fn new(config: &Config) -> Result { @@ -156,19 +157,21 @@ async fn _check_server_version(database: &DatabaseHandler) -> Result