Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix is_enterprise function #369

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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