Skip to content

Commit

Permalink
Fix is_enterprise function (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien authored Oct 16, 2023
1 parent 6be84d1 commit b7a9c5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,12 @@ impl Context {
/// Return error in case it was not possible to determind the deployment.
fn is_enterprise_internal(&self) -> Result<bool, RedisError> {
let info_res = self.call("info", &["server"])?;
match info_res {
RedisValue::BulkRedisString(res) => Ok(res.try_as_str()?.contains("rlec_version:")),
_ => Err(RedisError::Str("Mismatch call reply type")),
}
let info = match &info_res {
RedisValue::BulkRedisString(res) => res.try_as_str()?,
RedisValue::SimpleString(res) => res.as_str(),
_ => return Err(RedisError::Str("Mismatch call reply type")),
};
Ok(info.contains("rlec_version:"))
}

/// Return `true` is the current Redis deployment is enterprise, otherwise `false`.
Expand Down

0 comments on commit b7a9c5b

Please sign in to comment.