Skip to content

Commit

Permalink
Add the compatible Redis version to the info command (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobiaozhao authored Dec 6, 2022
1 parent 9e4bb2c commit 38512b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "worker.h"

std::atomic<int> Server::unix_time_ = {0};
constexpr const char *REDIS_VERSION = "4.0.0";

Server::Server(Engine::Storage *storage, Config *config) : storage_(storage), config_(config) {
// init commands stats here to prevent concurrent insert, and cause core
Expand Down Expand Up @@ -783,6 +784,7 @@ void Server::GetServerInfo(std::string *info) {
time(&now);
string_stream << "# Server\r\n";
string_stream << "version:" << VERSION << "\r\n";
string_stream << "redis_version:" << REDIS_VERSION << "\r\n";
string_stream << "git_sha1:" << GIT_COMMIT << "\r\n";
string_stream << "os:" << name.sysname << " " << name.release << " " << name.machine << "\r\n";
#ifdef __GNUC__
Expand Down

0 comments on commit 38512b7

Please sign in to comment.